hudi-agent commented on code in PR #19575:
URL: https://github.com/apache/hudi/pull/19575#discussion_r3778058069


##########
hudi-common/src/main/java/org/apache/hudi/common/config/metrics/HoodieMetricsConfig.java:
##########
@@ -109,6 +109,17 @@ public class HoodieMetricsConfig extends HoodieConfig {
       .sinceVersion("0.13.0")
       .withDocumentation("Enable metrics for locking infra. Useful when 
operating in multiwriter mode");
 
+  public static final ConfigProperty<Boolean> RLI_LOOKUP_METRICS_ENABLE = 
ConfigProperty
+      .key(METRIC_PREFIX + ".rli.lookup.enable")
+      .defaultValue(true)

Review Comment:
   🤖 Since this defaults to `true`, every RLI upsert commit will permanently 
stamp ~8 extra entries into commit metadata (retained through archival) for all 
existing RLI tables on upgrade, with no opt-in. You flagged this as the open 
question in the description — @yihua, do we want the default to be `false` 
given the permanent timeline footprint, or is default-on acceptable here?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metrics/RecordIndexMetricNames.java:
##########
@@ -0,0 +1,227 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.metrics;
+
+import org.apache.hudi.common.metrics.Registry;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.config.HoodieWriteConfig;
+
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Counter names for the record level index lookup phase, and the 
commit-boundary drain that publishes
+ * them.
+ *
+ * <p>Lives in hudi-client-common rather than hudi-spark-client so the shared 
commit path can reach it.
+ * Because the drain happens on that shared path, it applies to every engine 
write path -- Spark
+ * DataSource, Spark SQL and DeltaStreamer -- without any of them knowing 
about it.
+ */
+public class RecordIndexMetricNames {
+
+  /** Base registry name; the key actually used is scoped per table instance, 
see {@link #registryName}. */
+  public static final String REGISTRY_NAME = "HoodieRecordIndexLookup";
+
+  /** Prefix under which counters are stamped into commit metadata. */

Review Comment:
   🤖 nit: the name `RecordIndexMetricNames` reads like a constants holder, but 
this class also owns the snapshot/publish/release drain logic and the 
`LookupCounters` type. Could you rename it to something that reflects that 
responsibility (e.g. `RecordIndexLookupCounters` or `...MetricsDrain`)? A 
caller seeing `RecordIndexMetricNames.snapshotIntoCommitMetadata(...)` doesn't 
expect behavior from a "Names" class.
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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