Package com.hazelcast.jet.core
Interface ProcessorSupplier
- All Superinterfaces:
com.hazelcast.security.impl.function.SecuredFunction
,Serializable
- All Known Implementing Classes:
ProcessorMetaSupplier.ExpectNothingProcessorSupplier
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface ProcessorSupplier
extends Serializable, com.hazelcast.security.impl.function.SecuredFunction
Factory of
Processor
instances. Part of the initialization
chain as explained on ProcessorMetaSupplier
.- Since:
- Jet 3.0
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Context passed to the supplier in theinit()
call. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
Called after the execution has finished on this member - successfully or not.default boolean
Returnstrue
if theclose(Throwable)
method of this instance is cooperative.Collection<? extends Processor>
get
(int count) Called afterinit(Context)
to retrieve instances ofProcessor
that will be used during the execution of the Jet job.default void
init
(ProcessorSupplier.Context context) Called on each cluster member after deserialization.default boolean
Returnstrue
if theinit(Context)
method of this instance is cooperative.static ProcessorSupplier
of
(SupplierEx<? extends Processor> processorSupplier) Returns aProcessorSupplier
which will delegate to the givenSupplier<Processor>
to create allProcessor
instances.Methods inherited from interface com.hazelcast.security.impl.function.SecuredFunction
permissions
-
Method Details
-
init
Called on each cluster member after deserialization.- Throws:
Exception
-
initIsCooperative
default boolean initIsCooperative()Returnstrue
if theinit(Context)
method of this instance is cooperative. If it's not, the call to theinit()
method is off-loaded to another thread.- Since:
- 5.2
-
get
Called afterinit(Context)
to retrieve instances ofProcessor
that will be used during the execution of the Jet job.- Parameters:
count
- the number of processor this method is required to create and return. It is equal toProcessorMetaSupplier.Context.localParallelism()
.
-
closeIsCooperative
default boolean closeIsCooperative()Returnstrue
if theclose(Throwable)
method of this instance is cooperative. If it's not, the call to theclose()
method is off-loaded to another thread.- Since:
- 5.2
-
close
Called after the execution has finished on this member - successfully or not. The execution might still be running on other members. This method will be called afterProcessor.close()
has been called on all processors running on this member for this job.If this method throws an exception, it will be logged and ignored; it won't be reported as a job failure.
Note: this method can be called even if
init()
orget()
methods were not called in case the job fails during the init phase.- Parameters:
error
- the exception (if any) that caused the job to fail;null
in the case of successful job completion. Note that it might not be the actual error that caused the job to fail - it can be several other exceptions. We only guarantee that it's non-null if the job didn't complete successfully.- Throws:
Exception
-
of
Returns aProcessorSupplier
which will delegate to the givenSupplier<Processor>
to create allProcessor
instances.
-