public abstract class ParallelStrategyExecutor extends Object
| 构造器和说明 |
|---|
ParallelStrategyExecutor() |
| 限定符和类型 | 方法和说明 |
|---|---|
abstract void |
execute(WhenCondition whenCondition,
Integer slotIndex) |
protected Stream<Executable> |
filterAccess(Stream<Executable> stream,
Integer slotIndex,
String currentChainId) |
protected Stream<Executable> |
filterWhenTaskList(List<Executable> executableList,
Integer slotIndex,
String currentChainId)
过滤 WHEN 待执行任务
|
protected List<CompletableFuture<WhenFutureObj>> |
getWhenAllTaskList(WhenCondition whenCondition,
Integer slotIndex)
获取所有任务 CompletableFuture 集合
|
protected ExecutorService |
getWhenExecutorService(WhenCondition whenCondition)
获取 WHEN 所需线程池
|
protected void |
handleTaskResult(WhenCondition whenCondition,
Integer slotIndex,
List<CompletableFuture<WhenFutureObj>> whenAllFutureList,
CompletableFuture<?> specifyTask)
任务结果处理
|
protected void |
setWhenConditionParams(WhenCondition whenCondition)
设置 WhenCondition 参数
|
protected CompletableFuture<WhenFutureObj> |
wrappedFutureObj(Executable executable,
ExecutorService parallelExecutor,
WhenCondition whenCondition,
String currChainId,
Integer slotIndex)
封装 CompletableFuture 对象
|
protected final LFLog LOG
protected CompletableFuture<WhenFutureObj> wrappedFutureObj(Executable executable, ExecutorService parallelExecutor, WhenCondition whenCondition, String currChainId, Integer slotIndex)
executable - parallelExecutor - whenCondition - currChainId - slotIndex - protected void setWhenConditionParams(WhenCondition whenCondition)
whenCondition - protected Stream<Executable> filterWhenTaskList(List<Executable> executableList, Integer slotIndex, String currentChainId)
executableList - 所有任务列表slotIndex - currentChainId - 当前执行的 chainIdprotected Stream<Executable> filterAccess(Stream<Executable> stream, Integer slotIndex, String currentChainId)
protected ExecutorService getWhenExecutorService(WhenCondition whenCondition)
whenCondition - protected List<CompletableFuture<WhenFutureObj>> getWhenAllTaskList(WhenCondition whenCondition, Integer slotIndex)
whenCondition - slotIndex - protected void handleTaskResult(WhenCondition whenCondition, Integer slotIndex, List<CompletableFuture<WhenFutureObj>> whenAllFutureList, CompletableFuture<?> specifyTask) throws Exception
whenCondition - 并行组件对象slotIndex - 当前 slot 的 indexwhenAllFutureList - 并行组件中所有任务列表specifyTask - 指定预先完成的任务,详见 ParallelStrategyEnumExceptionpublic abstract void execute(WhenCondition whenCondition, Integer slotIndex) throws Exception
ExceptionCopyright © 2024. All rights reserved.