You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/09/19 06:25:39 UTC

[GitHub] [inlong] thesumery commented on a diff in pull request #5906: [INLONG-5903][Sort] Make InLong metric constructs factory more cohesive

thesumery commented on code in PR #5906:
URL: https://github.com/apache/inlong/pull/5906#discussion_r973896585


##########
inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/metric/MetricOption.java:
##########
@@ -34,31 +40,33 @@ public class MetricOption {
             + "3}|65[0-4]\\d{"
             + "2}|655[0-2]\\d|6553[0-5])$";
 
-    private String groupId;
-    private String streamId;
-    private String nodeId;
+    private Map<String, String> labels;
     private final HashSet<String> ipPortList;
     private String ipPorts;
     private RegisteredMetric registeredMetric;
 
     private MetricOption(
-            String inlongGroupStreamNode,
+            String inlongLabels,
             @Nullable String inlongAudit,
             @Nullable RegisteredMetric registeredMetric) {
-        Preconditions.checkNotNull(inlongGroupStreamNode,
-                "Inlong group stream node must be set for register metric.");
-        if (inlongGroupStreamNode != null) {
-            String[] inLongGroupStreamNodeArray = inlongGroupStreamNode.split(DELIMITER);
-            Preconditions.checkArgument(inLongGroupStreamNodeArray.length == 3,
-                    "Error inLong metric format: " + inlongGroupStreamNode);
-            this.groupId = inLongGroupStreamNodeArray[0];
-            this.streamId = inLongGroupStreamNodeArray[1];
-            this.nodeId = inLongGroupStreamNodeArray[2];
-        }
+        Preconditions.checkArgument(!StringUtils.isNullOrWhitespaceOnly(inlongLabels),
+                "Inlong labels must be set for register metric.");
+
+        this.labels = new HashMap<>();

Review Comment:
   OK



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org