DomGarguilo commented on code in PR #5616:
URL: https://github.com/apache/accumulo/pull/5616#discussion_r2150368327


##########
server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsInfoImpl.java:
##########
@@ -237,6 +254,41 @@ public synchronized void close() {
     Metrics.globalRegistry.close();
   }
 
+  /**
+   * Description of what the function does.
+   *
+   * @param patternList Description of what this variable is, i.e. 
comma-delimited regext patterns
+   * @return description of what this function returns, i.e. a predicate
+   */
+  public static MeterFilter getMeterFilter(String patternList) {
+    requireNonNull(patternList, "patternList must not be null");
+    Preconditions.checkArgument(!patternList.isEmpty(), "patternList must not 
be empty");
+
+    String[] patterns = patternList.split(",");
+    Predicate<Meter.Id> finalPredicate = null;

Review Comment:
   I think if you initialize `finalPredicate` to `id -> false;` you'll be able 
to just `OR` together the predicates in the loop below and also you wont have 
to `requireNonNullElseGet` in the return statement. 



##########
server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsInfoImpl.java:
##########
@@ -237,6 +254,41 @@ public synchronized void close() {
     Metrics.globalRegistry.close();
   }
 
+  /**
+   * Description of what the function does.
+   *
+   * @param patternList Description of what this variable is, i.e. 
comma-delimited regext patterns
+   * @return description of what this function returns, i.e. a predicate
+   */

Review Comment:
   This looks like auto generated javadoc. This should probably be updated



##########
server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsInfoImpl.java:
##########
@@ -237,6 +254,41 @@ public synchronized void close() {
     Metrics.globalRegistry.close();
   }
 
+  /**
+   * Description of what the function does.
+   *
+   * @param patternList Description of what this variable is, i.e. 
comma-delimited regext patterns
+   * @return description of what this function returns, i.e. a predicate
+   */
+  public static MeterFilter getMeterFilter(String patternList) {
+    requireNonNull(patternList, "patternList must not be null");
+    Preconditions.checkArgument(!patternList.isEmpty(), "patternList must not 
be empty");

Review Comment:
   I'm wondering if we should allow an empty value here. The default value is 
currently an empty String anyways. We could just handle an empty string as no 
filter.



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