fix: modify by suggestion

This commit is contained in:
ocean23 2021-01-16 17:14:10 +08:00
parent 62aeb9c080
commit e429c6f59e

View File

@ -343,15 +343,13 @@ public class ProcessorTracker {
if (executeType == ExecuteType.MAP_REDUCE || executeType == ExecuteType.MAP) {
return instanceInfo.getThreadConcurrency();
}
boolean exeStandalone = executeType == ExecuteType.STANDALONE;
boolean fixedJob = TimeExpressionType.frequentTypes.contains(instanceInfo.getTimeExpressionType());
if (exeStandalone && fixedJob) {
return instanceInfo.getThreadConcurrency();
}
// 脚本类自带线程池不过为了少一点逻辑判断还是象征性分配一个线程
if (processorType == ProcessorType.PYTHON || processorType == ProcessorType.SHELL) {
return 1;
}
if (TimeExpressionType.frequentTypes.contains(instanceInfo.getTimeExpressionType())) {
return instanceInfo.getThreadConcurrency();
}
return 2;
}