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


##########
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());

Review Comment:
   wg不带逗号时为空,意思是匹配所有。
   wg带逗号时,就不可能为空,写入时有校验。
   backend的tag目前没有校验,用户自己写错了,那就不匹配,自己去检查



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