nsivabalan commented on code in PR #8759: URL: https://github.com/apache/hudi/pull/8759#discussion_r1210801846
########## hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/table/action/compact/TestHoodieCompactor.java: ########## @@ -129,6 +152,10 @@ public void testCompactionEmpty() { String compactionInstantTime = HoodieActiveTimeline.createNewInstantTime(); Option<HoodieCompactionPlan> plan = table.scheduleCompaction(context, compactionInstantTime, Option.empty()); assertFalse(plan.isPresent(), "If there is nothing to compact, result will be empty"); + + // Verify compaction.requested, compaction.completed metrics counts. + assertEquals(0, getCompactionMetricCount("counter", "compaction.requested")); Review Comment: can we re-use the variables here instead of hard coding the metric names ? ########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/compact/RunCompactionActionExecutor.java: ########## @@ -116,6 +128,8 @@ public HoodieWriteMetadata<HoodieData<WriteStatus>> execute() { throw new HoodieCompactionException("Could not compact " + config.getBasePath(), e); } + LOG.info("Compaction completed."); Review Comment: can we add the instant time for compaction ########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/compact/RunCompactionActionExecutor.java: ########## @@ -65,10 +73,14 @@ public RunCompactionActionExecutor(HoodieEngineContext context, this.operationType = operationType; checkArgument(operationType == WriteOperationType.COMPACT || operationType == WriteOperationType.LOG_COMPACT, "Only COMPACT and LOG_COMPACT is supported"); + metrics = new HoodieMetrics(config); } @Override public HoodieWriteMetadata<HoodieData<WriteStatus>> execute() { + LOG.info("Compaction requested."); Review Comment: can we add the instant time for compaction ########## hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/table/action/compact/TestHoodieCompactor.java: ########## @@ -180,6 +208,10 @@ public void testWriteStatusContentsAfterCompaction() throws Exception { HoodieData<WriteStatus> result = compact(writeClient, compactionInstantTime); verifyCompaction(result); + + // Verify compaction.requested, compaction.completed metrics counts. + assertEquals(1, getCompactionMetricCount("counter", "compaction.requested")); Review Comment: same here ########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/compact/RunCompactionActionExecutor.java: ########## @@ -48,10 +52,14 @@ public class RunCompactionActionExecutor<T> extends BaseActionExecutor<T, HoodieData<HoodieRecord<T>>, HoodieData<HoodieKey>, HoodieData<WriteStatus>, HoodieWriteMetadata<HoodieData<WriteStatus>>> { + private static final Logger LOG = LoggerFactory.getLogger(LogCompactionExecutionHelper.class); + Review Comment: RunCompactionActionExecutor.class -- 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: commits-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org