This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch spill_and_reserve in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/spill_and_reserve by this push: new b523fc3e293 fix not show writer buffer ratio and slot memory policy problem (#42977) b523fc3e293 is described below commit b523fc3e2934f5a385de42b908c36e3ebde7de91 Author: yiguolei <676222...@qq.com> AuthorDate: Thu Oct 31 12:00:40 2024 +0800 fix not show writer buffer ratio and slot memory policy problem (#42977) ## Proposed changes Issue Number: close #xxx <!--Describe your changes.--> --------- Co-authored-by: yiguolei <yiguo...@gmail.com> --- .../doris/resource/workloadgroup/WorkloadGroup.java | 20 +++++++++++++------- .../resource/workloadgroup/WorkloadGroupMgr.java | 2 ++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroup.java b/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroup.java index c2a4e97e9c4..d99287a0312 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroup.java +++ b/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroup.java @@ -289,15 +289,14 @@ public class WorkloadGroup implements Writable, GsonPostProcessable { } if (properties.containsKey(WRITE_BUFFER_RATIO)) { - String memoryLimit = properties.get(WRITE_BUFFER_RATIO); - if (!memoryLimit.endsWith("%")) { - throw new DdlException(WRITE_BUFFER_RATIO + " " + memoryLimit - + " requires a percentage and ends with a '%'"); - } - String memLimitErr = WRITE_BUFFER_RATIO + " " + memoryLimit + String writeBufSizeStr = properties.get(WRITE_BUFFER_RATIO); + String memLimitErr = WRITE_BUFFER_RATIO + " " + writeBufSizeStr + " requires a positive int number."; + if (writeBufSizeStr.endsWith("%")) { + writeBufSizeStr = writeBufSizeStr.substring(0, writeBufSizeStr.length() - 1); + } try { - if (Integer.parseInt(memoryLimit.substring(0, memoryLimit.length() - 1)) < 0) { + if (Integer.parseInt(writeBufSizeStr) < 0) { throw new DdlException(memLimitErr); } } catch (NumberFormatException e) { @@ -550,6 +549,13 @@ public class WorkloadGroup implements Writable, GsonPostProcessable { } } else if (ENABLE_MEMORY_OVERCOMMIT.equals(key) && !properties.containsKey(key)) { row.add("true"); + } else if (SLOT_MEMORY_POLICY.equals(key)) { + String val = properties.get(key); + if (StringUtils.isEmpty(val)) { + row.add(SLOT_MEMORY_POLICY_DEFAULT_VALUE); + } else { + row.add(val); + } } else if (SCAN_THREAD_NUM.equals(key) && !properties.containsKey(key)) { row.add("-1"); } else if (MAX_REMOTE_SCAN_THREAD_NUM.equals(key) && !properties.containsKey(key)) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroupMgr.java b/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroupMgr.java index 8464d83bdbc..4c2d15ec6af 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroupMgr.java +++ b/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroupMgr.java @@ -74,6 +74,8 @@ public class WorkloadGroupMgr extends MasterDaemon implements Writable, GsonPost public static final ImmutableList<String> WORKLOAD_GROUP_PROC_NODE_TITLE_NAMES = new ImmutableList.Builder<String>() .add("Id").add("Name").add(WorkloadGroup.CPU_SHARE).add(WorkloadGroup.MEMORY_LIMIT) .add(WorkloadGroup.ENABLE_MEMORY_OVERCOMMIT) + .add(WorkloadGroup.WRITE_BUFFER_RATIO) + .add(WorkloadGroup.SLOT_MEMORY_POLICY) .add(WorkloadGroup.MAX_CONCURRENCY).add(WorkloadGroup.MAX_QUEUE_SIZE) .add(WorkloadGroup.QUEUE_TIMEOUT).add(WorkloadGroup.CPU_HARD_LIMIT) .add(WorkloadGroup.SCAN_THREAD_NUM).add(WorkloadGroup.MAX_REMOTE_SCAN_THREAD_NUM) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org