Fix remote scan pool (#33976)

This commit is contained in:
wangbo
2024-04-25 10:11:56 +08:00
committed by yiguolei
parent 5f2d0e3d53
commit 47b54d4bd5
6 changed files with 145 additions and 35 deletions

View File

@ -272,6 +272,7 @@ public class WorkloadGroup implements Writable, GsonPostProcessable {
}
}
int maxRemoteScanNum = -1;
if (properties.containsKey(MAX_REMOTE_SCAN_THREAD_NUM)) {
String value = properties.get(MAX_REMOTE_SCAN_THREAD_NUM);
try {
@ -279,12 +280,14 @@ public class WorkloadGroup implements Writable, GsonPostProcessable {
if (intValue <= 0 && intValue != -1) {
throw new NumberFormatException();
}
maxRemoteScanNum = intValue;
} catch (NumberFormatException e) {
throw new DdlException(
MAX_REMOTE_SCAN_THREAD_NUM + " must be a positive integer or -1. but input value is " + value);
}
}
int minRemoteScanNum = -1;
if (properties.containsKey(MIN_REMOTE_SCAN_THREAD_NUM)) {
String value = properties.get(MIN_REMOTE_SCAN_THREAD_NUM);
try {
@ -292,12 +295,20 @@ public class WorkloadGroup implements Writable, GsonPostProcessable {
if (intValue <= 0 && intValue != -1) {
throw new NumberFormatException();
}
minRemoteScanNum = intValue;
} catch (NumberFormatException e) {
throw new DdlException(
MIN_REMOTE_SCAN_THREAD_NUM + " must be a positive integer or -1. but input value is " + value);
}
}
if ((maxRemoteScanNum == -1 && minRemoteScanNum != -1) || (maxRemoteScanNum != -1 && minRemoteScanNum == -1)) {
throw new DdlException(MAX_REMOTE_SCAN_THREAD_NUM + " and " + MIN_REMOTE_SCAN_THREAD_NUM
+ " must be specified simultaneously");
} else if (maxRemoteScanNum < minRemoteScanNum) {
throw new DdlException(MAX_REMOTE_SCAN_THREAD_NUM + " must bigger or equal " + MIN_REMOTE_SCAN_THREAD_NUM);
}
// check queue property
if (properties.containsKey(MAX_CONCURRENCY)) {
try {