This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit e5994ca73b8991b24ae1a3a0b50fb6a09850bed0
Author: Chesnay Schepler <[email protected]>
AuthorDate: Fri Mar 12 12:44:20 2021 +0100

    [hotfix][metrics] Adjust variable name
---
 .../runtime/metrics/groups/TaskMetricGroup.java     | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/TaskMetricGroup.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/TaskMetricGroup.java
index f96f01c..b99cccc 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/TaskMetricGroup.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/TaskMetricGroup.java
@@ -144,31 +144,32 @@ public class TaskMetricGroup extends 
ComponentMetricGroup<TaskManagerJobMetricGr
     //  operators and cleanup
     // ------------------------------------------------------------------------
 
-    public OperatorMetricGroup getOrAddOperator(String name) {
-        return getOrAddOperator(OperatorID.fromJobVertexID(vertexId), name);
+    public OperatorMetricGroup getOrAddOperator(String operatorName) {
+        return getOrAddOperator(OperatorID.fromJobVertexID(vertexId), 
operatorName);
     }
 
-    public OperatorMetricGroup getOrAddOperator(OperatorID operatorID, String 
name) {
-        final String metricName;
-        if (name != null && name.length() > METRICS_OPERATOR_NAME_MAX_LENGTH) {
+    public OperatorMetricGroup getOrAddOperator(OperatorID operatorID, String 
operatorName) {
+        final String truncatedOperatorName;
+        if (operatorName != null && operatorName.length() > 
METRICS_OPERATOR_NAME_MAX_LENGTH) {
             LOG.warn(
                     "The operator name {} exceeded the {} characters length 
limit and was truncated.",
-                    name,
+                    operatorName,
                     METRICS_OPERATOR_NAME_MAX_LENGTH);
-            metricName = name.substring(0, METRICS_OPERATOR_NAME_MAX_LENGTH);
+            truncatedOperatorName = operatorName.substring(0, 
METRICS_OPERATOR_NAME_MAX_LENGTH);
         } else {
-            metricName = name;
+            truncatedOperatorName = operatorName;
         }
 
         // unique OperatorIDs only exist in streaming, so we have to rely on 
the name for batch
         // operators
-        final String key = operatorID + metricName;
+        final String key = operatorID + truncatedOperatorName;
 
         synchronized (this) {
             return operators.computeIfAbsent(
                     key,
                     operator ->
-                            new OperatorMetricGroup(this.registry, this, 
operatorID, metricName));
+                            new OperatorMetricGroup(
+                                    this.registry, this, operatorID, 
truncatedOperatorName));
         }
     }
 

Reply via email to