E - Processor typepublic class CloseableProcessorSupplier<E extends Processor & Closeable> extends Object implements ProcessorSupplier
ProcessorSupplier which closes created processor instances
when the job is complete.ProcessorSupplier.Context| Constructor and Description |
|---|
CloseableProcessorSupplier(DistributedIntFunction<Collection<E>> supplier) |
CloseableProcessorSupplier(DistributedSupplier<E> simpleSupplier) |
| Modifier and Type | Method and Description |
|---|---|
void |
complete(Throwable error)
Called after the execution has finished on all members, successfully
or not, or immediately, when the execution was aborted due to
a member leaving the cluster.
|
Collection<E> |
get(int count)
Called after
ProcessorSupplier.init(Context) to retrieve instances of
Processor that will be used during the execution of the Jet job. |
void |
init(ProcessorSupplier.Context context)
Called on each cluster member after deserialization.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitofpublic CloseableProcessorSupplier(DistributedSupplier<E> simpleSupplier)
simpleSupplier - Supplier to create processor instances.
Parameter is the local processor index.public CloseableProcessorSupplier(DistributedIntFunction<Collection<E>> supplier)
supplier - Supplier to create processor instances.public void init(@Nonnull ProcessorSupplier.Context context)
ProcessorSupplierinit in interface ProcessorSupplier@Nonnull public Collection<E> get(int count)
ProcessorSupplierProcessorSupplier.init(Context) to retrieve instances of
Processor that will be used during the execution of the Jet job.get in interface ProcessorSuppliercount - the number of processor this method is required to create
and returnpublic void complete(Throwable error)
ProcessorSupplier
Note: this method can be called even if init() or
get() were not called yet in case the job fails during
the init phase.
complete in interface ProcessorSuppliererror - the exception (if any) that caused the job to fail;
null in the case of successful job completionCopyright © 2017 Hazelcast, Inc.. All Rights Reserved.