[bugfix](workloadgroup) could not upgrade from 2.0 alpha (#21149)

---------

Co-authored-by: yiguolei <yiguolei@gmail.com>
This commit is contained in:
yiguolei
2023-06-25 22:02:53 +08:00
committed by GitHub
parent 2d1163c4d8
commit 64790a3a86

View File

@ -281,8 +281,14 @@ public class WorkloadGroup implements Writable, GsonPostProcessable {
@Override
public void gsonPostProcess() throws IOException {
String memoryLimitString = properties.get(MEMORY_LIMIT);
this.memoryLimitPercent = Double.parseDouble(memoryLimitString.substring(0, memoryLimitString.length() - 1));
if (properties.containsKey(MEMORY_LIMIT)) {
String memoryLimitString = properties.get(MEMORY_LIMIT);
this.memoryLimitPercent = Double.parseDouble(memoryLimitString.substring(0,
memoryLimitString.length() - 1));
} else {
this.memoryLimitPercent = 100;
this.properties.put(MEMORY_LIMIT, "100%");
}
this.initQueryQueue();
}
}