R - 聚合结果类型public class ParallelDistributeAggregator<R> extends AbstractAggregator implements DistributeAggregator<R>
DistributeAggregator| 限定符和类型 | 类和说明 |
|---|---|
private static class |
ParallelDistributeAggregator.MergerNode<V,R> |
| 限定符和类型 | 字段和说明 |
|---|---|
private Executor |
executor |
private org.slf4j.Logger |
logger |
private Class<R> |
resultClass
返回结果类型,该类型必须有无参构造器
|
private long |
timeout
聚合器执行超时时间
|
| 构造器和说明 |
|---|
ParallelDistributeAggregator(@NotNull Executor executor,
@NotNull Class<R> resultClass) |
ParallelDistributeAggregator(@NotNull Executor executor,
@NotNull Class<R> resultClass,
long timeout) |
ParallelDistributeAggregator(@NotNull Executor executor,
@NotNull Class<R> resultClass,
long timeout,
@NotNull TimeUnit unit) |
| 限定符和类型 | 方法和说明 |
|---|---|
R |
aggregate(@NotNull Context context,
List<DistributeMergeableNode<?,R>> nodes)
对可聚合的节点进行结果聚合,并返回聚合后的结果
|
void |
destroy() |
private CompletableFuture<?> |
getFuture(Context context,
DistributeMergeableNode<?,R> node,
BlockingQueue<ParallelDistributeAggregator.MergerNode<?,R>> mergerNodes,
R result) |
initializeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializeprivate final org.slf4j.Logger logger
private Executor executor
private long timeout
public ParallelDistributeAggregator(@NotNull
@NotNull Executor executor,
@NotNull
@NotNull Class<R> resultClass)
public ParallelDistributeAggregator(@NotNull
@NotNull Executor executor,
@NotNull
@NotNull Class<R> resultClass,
long timeout)
@NotNull public R aggregate(@NotNull @NotNull Context context, List<DistributeMergeableNode<?,R>> nodes) throws Exception
DistributeAggregatoraggregate 在接口中 Aggregator<R,DistributeMergeableNode<?,R>>aggregate 在接口中 DistributeAggregator<R>context - 流程上下文nodes - 可合并结果节点ExceptionMergeableNodeprivate CompletableFuture<?> getFuture(Context context, DistributeMergeableNode<?,R> node, BlockingQueue<ParallelDistributeAggregator.MergerNode<?,R>> mergerNodes, R result)
public void destroy()
destroy 在接口中 Lifecycledestroy 在类中 AbstractAggregatorCopyright © 2021. All rights reserved.