yiguolei commented on code in PR #51465:
URL: https://github.com/apache/doris/pull/51465#discussion_r2125857135
##########
fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/WorkloadGroupMgr.java:
##########
@@ -371,16 +375,18 @@ public void alterWorkloadGroup(AlterWorkloadGroupStmt
stmt) throws DdlException
}
public void alterWorkloadGroup(String computeGroup, String
workloadGroupName, Map<String, String> properties)
- throws DdlException {
+ throws UserException {
if (properties.size() == 0) {
throw new DdlException("Alter workload group should contain at
least one property");
}
+ ComputeGroup cg =
Env.getCurrentEnv().getComputeGroupMgr().getComputeGroupByName(computeGroup);
WorkloadGroup newWorkloadGroup;
WorkloadGroupKey wgKey = WorkloadGroupKey.get(computeGroup,
workloadGroupName);
writeLock();
try {
- WorkloadGroup currentWorkloadGroup =
getWorkloadGroupByComputeGroupUnlock(wgKey);
+ // get 0 idx here because there can only be one wg in cg with
specify wg name.
+ WorkloadGroup currentWorkloadGroup =
cg.getWorkloadGroup(workloadGroupName).get(0);
Review Comment:
这里需要判断一下 length 是否大于1,否则需要报错
如果小于1,也需要报错
--
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]