yiguolei commented on code in PR #38486:
URL: https://github.com/apache/doris/pull/38486#discussion_r1697794719


##########
fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroup.java:
##########
@@ -605,11 +619,39 @@ public TopicInfo toTopicInfo() {
             
tWorkloadGroupInfo.setRemoteReadBytesPerSecond(Long.valueOf(remoteReadBytesPerSecStr));
         }
 
+        String tagStr = properties.get(TAG);
+        if (!StringUtils.isEmpty(tagStr)) {
+            tWorkloadGroupInfo.setTag(tagStr);
+        }
+
         TopicInfo topicInfo = new TopicInfo();
         topicInfo.setWorkloadGroupInfo(tWorkloadGroupInfo);
         return topicInfo;
     }
 
+    public static boolean isMatchBackendTag(String wgTagStr, String beTagStr) {
+        if (StringUtils.isEmpty(wgTagStr)) {
+            return true;
+        }
+        if (StringUtils.isEmpty(beTagStr)) {
+            return false;
+        }
+
+        String[] wgTagArr = wgTagStr.split(",");
+        Set<String> wgTagSet = new HashSet<>();
+        for (String wgTag : wgTagArr) {
+            wgTagSet.add(wgTag.trim());
+        }
+
+        String[] beTagArr = beTagStr.split(",");
+        Set<String> beTagSet = new HashSet<>();
+        for (String beTag : beTagArr) {
+            beTagSet.add(beTag.trim());
+        }
+

Review Comment:
   感觉应该在这里检查两个集合,是否有空集合存在。
   如果只检查string 是否是empty,还得检查是否是空字符串



-- 
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-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to