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


##########
fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroup.java:
##########
@@ -553,6 +614,52 @@ public long getVersion() {
         return version;
     }
 
+    public int getMinCpuPercent() {
+        String minCpuPercentStr = properties.get(MIN_CPU_PERCENT);
+        if (minCpuPercentStr.endsWith("%")) {
+            return Integer.valueOf(minCpuPercentStr.substring(0, 
minCpuPercentStr.length() - 1));
+        }
+        return Integer.valueOf(minCpuPercentStr);
+    }
+
+    public int getMaxCpuPercent() {
+        String maxCpuPercentStr = properties.get(MAX_CPU_PERCENT);
+        if (maxCpuPercentStr.endsWith("%")) {
+            return Integer.valueOf(maxCpuPercentStr.substring(0, 
maxCpuPercentStr.length() - 1));
+        }
+        return Integer.valueOf(maxCpuPercentStr);
+    }
+
+    public int getMinMemoryPercent() {
+        String minMemPercentStr = properties.get(MIN_MEMORY_PERCENT);
+        if (minMemPercentStr.endsWith("%")) {
+            return Integer.valueOf(minMemPercentStr.substring(0,
+                    minMemPercentStr.length() - 1));
+        }
+        return Integer.valueOf(minMemPercentStr);
+    }
+
+    public int getMaxMemoryPercent() {
+        String maxMemPercentStr = properties.get(MAX_MEMORY_PERCENT);

Review Comment:
   这种写法可读性稍微差点,容易引起误解。实际只有创建或者alter的时候会以%结尾



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