zachjsh commented on code in PR #12488:
URL: https://github.com/apache/druid/pull/12488#discussion_r869618005


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:
##########
@@ -422,9 +423,40 @@ public boolean isPerfectRollup()
     return tuningConfig != null && tuningConfig.isForceGuaranteedRollup();
   }
 
+  @VisibleForTesting
+  void emitCompactIngestionModeMetrics(
+      ServiceEmitter emitter,
+      boolean isDropExisting
+  )
+  {
+
+    if (emitter == null) {
+      return;
+    }
+
+    BatchIngestionMode mode = getBatchIngestionMode(
+        false, // compact never supports append mode
+        isDropExisting
+    );
+    // compact does not support APPEND
+    switch (mode) {
+      case REPLACE:
+        emitter.emit(buildEvent("compact/replace/count", 1));
+        break;
+      case OVERWRITE:
+        emitter.emit(buildEvent("compact/overwrite/count", 1));
+        break;
+      default:
+        throw new ISE("Invalid compact ingestion mode [%s]", mode);

Review Comment:
   Should we just log error instead of possibly failing ingestion task with 
this thrown exception?



-- 
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