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


##########
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:
   目前的校验规则是以wg的tag为视角的,wg的为空就匹配所有,不为空就看be有没有能匹配上的,be怎么写就不用关注



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to