cshuo commented on code in PR #18762:
URL: https://github.com/apache/hudi/pull/18762#discussion_r3263551194


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/DynamicBucketAssignFunction.java:
##########
@@ -65,6 +66,7 @@ public class DynamicBucketAssignFunction
 
   private transient PartitionedIndexBackend indexBackend;
   private transient BucketAssigner bucketAssigner;
+  private transient FlinkBucketAssignMetrics metrics;

Review Comment:
   We can registration in the following pr, and keep the scope of the pr 
focused.



##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/index/GlobalRecordLevelIndexBackend.java:
##########
@@ -84,21 +95,33 @@ public void update(String recordKey, 
HoodieRecordGlobalLocation recordGlobalLoca
   public Map<String, HoodieRecordGlobalLocation> get(List<String> recordKeys) 
throws IOException {
     Map<String, HoodieRecordGlobalLocation> keysAndLocations = new HashMap<>();
     List<String> missedKeys = new ArrayList<>();
-    for (String key: recordKeys) {
+
+    metrics.startLocalIndexLookup();
+    int localHits = 0;

Review Comment:
   `localHits` is not needed, can be inferred as `recordKeys.size() - 
missedKeys`



##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/index/GlobalRecordLevelIndexBackend.java:
##########
@@ -67,9 +71,16 @@ public GlobalRecordLevelIndexBackend(Configuration conf, 
long initCheckpointId)
     this.metaClient = StreamerUtil.createMetaClient(conf);
     this.conf = conf;
     this.recordIndexCache = new RecordIndexCache(conf, initCheckpointId);
+    registerMetrics(new UnregisteredMetricsGroup());

Review Comment:
   Why do we need this?



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