fix(sj_1.1.0-beta2): 修复注解mergeReduce执行失败问题

This commit is contained in:
opensnail 2024-06-26 23:36:49 +08:00
parent b9f9a9e00f
commit dd03b837ef

View File

@ -57,15 +57,16 @@ public class AnnotationMapReduceJobExecutor extends AbstractMapReduceExecutor {
throw new SnailJobMapReduceException("[{}] not found", mergeReduceArgs.getExecutorInfo()); throw new SnailJobMapReduceException("[{}] not found", mergeReduceArgs.getExecutorInfo());
} }
if (Objects.isNull(jobExecutorInfo.getReduceExecutor())) { Method mergeReduceExecutor = jobExecutorInfo.getMergeReduceExecutor();
if (Objects.isNull(mergeReduceExecutor)) {
throw new SnailJobMapReduceException( throw new SnailJobMapReduceException(
"[{}] MapTask execution method not found. Please configure the @MergeReduceExecutor annotation", "[{}] MapTask execution method not found. Please configure the @MergeReduceExecutor annotation",
mergeReduceArgs.getExecutorInfo()); mergeReduceArgs.getExecutorInfo());
} }
Class<?>[] paramTypes = jobExecutorInfo.getMergeReduceExecutor().getParameterTypes(); Class<?>[] paramTypes = mergeReduceExecutor.getParameterTypes();
if (paramTypes.length > 0) { if (paramTypes.length > 0) {
return (ExecuteResult) ReflectionUtils.invokeMethod(jobExecutorInfo.getReduceExecutor(), return (ExecuteResult) ReflectionUtils.invokeMethod(mergeReduceExecutor,
jobExecutorInfo.getExecutor(), mergeReduceArgs); jobExecutorInfo.getExecutor(), mergeReduceArgs);
} }