danny0405 commented on code in PR #11377:
URL: https://github.com/apache/hudi/pull/11377#discussion_r1625665630
##########
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:
And we may need to reload the active timeline to refresh the instant state.
--
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]