LXin96 commented on code in PR #11377:
URL: https://github.com/apache/hudi/pull/11377#discussion_r1624539082


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -272,6 +275,28 @@ public void notifyCheckpointComplete(long checkpointId) {
     );
   }
 
+  private void emitCompactionAndClusteringMetrics(Configuration conf,
+      HoodieTableMetaClient metaClient, HoodieFlinkWriteClient writeClient) {
+    if (conf.getBoolean(FlinkOptions.CLUSTERING_SCHEDULE_ENABLED)
+        && !conf.getBoolean(FlinkOptions.CLUSTERING_ASYNC_ENABLED)) {
+      HoodieTimeline pendingReplaceTimeline = metaClient.getActiveTimeline()
+          .filterPendingReplaceTimeline();
+      HoodieMetrics metrics = writeClient.getMetrics();
+      if (metrics != null) {
+        
metrics.setPendingClusteringCount(pendingReplaceTimeline.countInstants());
+      }
+    }
+    if (conf.getBoolean(FlinkOptions.COMPACTION_SCHEDULE_ENABLED)

Review Comment:
   @danny0405 en,i get you, however, this is another situation, when we 
FlinkOptions.COMPACTION_SCHEDULE_ENABLED set to true, 
FlinkOptions.COMPACTION_ASYNC_ENABLED set to false , the CompactionPlanOperator 
will not be added to pipeline, then will not report the pending compaction plan 
, the situation is as same as clustering. this situation happens to offload the 
clustering or compaction.



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

Reply via email to