echauchot commented on a change in pull request #14510:
URL: https://github.com/apache/flink/pull/14510#discussion_r555002432



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/AbstractMetricGroup.java
##########
@@ -119,12 +122,28 @@ public AbstractMetricGroup(MetricRegistry registry, 
String[] scope, A parent) {
         this.variables = new Map[registry.getNumberReporters() + 1];
     }
 
+    CharacterFilter wrapWithDefaultFilter(CharacterFilter filter, char 
delimiter) {
+        CharacterFilter defaultFilter = input -> input.replace(delimiter, 
DEFAULT_REPLACEMENT);
+        return filter == null
+                ? defaultFilter
+                : input -> 
defaultFilter.filterCharacters(filter.filterCharacters(input));
+    }
+
     @Override
     public Map<String, String> getAllVariables() {
-        return internalGetAllVariables(0, Collections.emptySet());
+        return internalGetAllVariables(null, 0, Collections.emptySet(), 
registry.getDelimiter());
+    }
+
+    @Override
+    public Map<String, String> getAllVariables(CharacterFilter filter) {
+        return internalGetAllVariables(filter, 0, Collections.emptySet(), 
registry.getDelimiter());
     }
 
-    public Map<String, String> getAllVariables(int reporterIndex, Set<String> 
excludedVariables) {
+    public Map<String, String> getAllVariables(
+            CharacterFilter filter,
+            int reporterIndex,
+            Set<String> excludedVariables,
+            char delimiter) {

Review comment:
       +1




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to