jtuglu1 commented on code in PR #18855:
URL: https://github.com/apache/druid/pull/18855#discussion_r2639956424


##########
processing/src/main/java/org/apache/druid/segment/incremental/RowIngestionMetersTotals.java:
##########
@@ -38,13 +42,49 @@ public RowIngestionMetersTotals(
       @JsonProperty("processedBytes") long processedBytes,
       @JsonProperty("processedWithError") long processedWithError,
       @JsonProperty("thrownAway") long thrownAway,
+      @JsonProperty("thrownAwayByReason") @Nullable Map<String, Long> 
thrownAwayByReason,
+      @JsonProperty("unparseable") long unparseable
+  )
+  {
+    this(
+        processed,
+        processedBytes,
+        processedWithError,
+        Configs.valueOrDefault(thrownAwayByReason, 
getBackwardsCompatibleThrownAwayByReason(thrownAway)),
+        unparseable
+    );
+  }
+
+  public RowIngestionMetersTotals(
+      @JsonProperty("processed") long processed,
+      @JsonProperty("processedBytes") long processedBytes,
+      @JsonProperty("processedWithError") long processedWithError,
+      @JsonProperty("thrownAway") long thrownAway,
+      @JsonProperty("unparseable") long unparseable
+  )
+  {
+    this(
+        processed,
+        processedBytes,
+        processedWithError,
+        getBackwardsCompatibleThrownAwayByReason(thrownAway),
+        unparseable
+    );
+  }
+
+  public RowIngestionMetersTotals(

Review Comment:
   Not necessarily in the future. Reasons for each:
   1. The main JSON ctor (needs both nullable `thrownAwayByReason` and 
`thrownAway` for backwards compatibility).
   2. Ctor for internal test usage that just uses thrownAway for backwards 
compatibility. IMO was cleaner than passing `null` for `thrownAwayByReason` to 
#1.
   3. New ctor (what +2 versions of Druid can default to) where 
`thrownAwayReason` is only key.



##########
processing/src/main/java/org/apache/druid/segment/incremental/RowIngestionMetersTotals.java:
##########
@@ -38,13 +42,49 @@ public RowIngestionMetersTotals(
       @JsonProperty("processedBytes") long processedBytes,
       @JsonProperty("processedWithError") long processedWithError,
       @JsonProperty("thrownAway") long thrownAway,
+      @JsonProperty("thrownAwayByReason") @Nullable Map<String, Long> 
thrownAwayByReason,
+      @JsonProperty("unparseable") long unparseable
+  )
+  {
+    this(
+        processed,
+        processedBytes,
+        processedWithError,
+        Configs.valueOrDefault(thrownAwayByReason, 
getBackwardsCompatibleThrownAwayByReason(thrownAway)),
+        unparseable
+    );
+  }
+
+  public RowIngestionMetersTotals(
+      @JsonProperty("processed") long processed,
+      @JsonProperty("processedBytes") long processedBytes,
+      @JsonProperty("processedWithError") long processedWithError,
+      @JsonProperty("thrownAway") long thrownAway,
+      @JsonProperty("unparseable") long unparseable
+  )
+  {
+    this(
+        processed,
+        processedBytes,
+        processedWithError,
+        getBackwardsCompatibleThrownAwayByReason(thrownAway),
+        unparseable
+    );
+  }
+
+  public RowIngestionMetersTotals(

Review Comment:
   Not necessarily in the future, but I thought it made things cleaner from 
client perspective. Reasons for each:
   1. The main JSON ctor (needs both nullable `thrownAwayByReason` and 
`thrownAway` for backwards compatibility).
   2. Ctor for internal test usage that just uses thrownAway for backwards 
compatibility. IMO was cleaner than passing `null` for `thrownAwayByReason` to 
#1.
   3. New ctor (what +2 versions of Druid can default to) where 
`thrownAwayReason` is only key.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to