@FunctionalInterface public interface ProcessorMetaSupplier extends Serializable
ProcessorSupplier
instances. The starting point of
the chain leading to the eventual creation of Processor
instances
on each cluster member:
ProcessorMetaSupplier
as a part of the DAG;
ProcessorSupplier
for each cluster member;
ProcessorSupplier
and sends it to its target member;
Processor
as requested by the parallelism property on
the corresponding Vertex
.
ProcessorSupplier
s this meta-supplier will
be given access to the Hazelcast instance and, in particular, its cluster topology
and partitioning services. It can use the information from these services to
precisely parameterize each Processor
instance that will be created on
each member.Modifier and Type | Interface and Description |
---|---|
static interface |
ProcessorMetaSupplier.Context
Context passed to the meta-supplier at init time on the member that
received a job request from the client.
|
Modifier and Type | Method and Description |
---|---|
default void |
complete(Throwable error)
Called on coordinator member after execution has finished on all
members, successfully or not.
|
static ProcessorMetaSupplier |
dontParallelize(DistributedSupplier<? extends Processor> procSupplier)
Factory method that wraps the given
Supplier<Processor>
and uses it as the supplier of all Processor instances. |
static ProcessorMetaSupplier |
dontParallelize(ProcessorSupplier supplier)
Wraps the provided
ProcessorSupplier into a meta-supplier that
will always return it. |
java.util.function.Function<com.hazelcast.nio.Address,ProcessorSupplier> |
get(List<com.hazelcast.nio.Address> addresses)
Called to create a mapping from member
Address to the
ProcessorSupplier that will be sent to that member. |
default void |
init(ProcessorMetaSupplier.Context context)
Called on the cluster member that receives the client request, after
deserializing the meta-supplier instance.
|
static ProcessorMetaSupplier |
of(DistributedFunction<com.hazelcast.nio.Address,ProcessorSupplier> addressToSupplier)
Factory method that creates a
ProcessorMetaSupplier from the
supplied function that maps a cluster member address to a ProcessorSupplier . |
static ProcessorMetaSupplier |
of(DistributedFunction<com.hazelcast.nio.Address,ProcessorSupplier> addressToSupplier,
int preferredLocalParallelism)
Factory method that creates a
ProcessorMetaSupplier from the
supplied function that maps a cluster member address to a ProcessorSupplier . |
static ProcessorMetaSupplier |
of(DistributedSupplier<? extends Processor> procSupplier)
Factory method that wraps the given
Supplier<Processor>
and uses it as the supplier of all Processor instances. |
static ProcessorMetaSupplier |
of(DistributedSupplier<? extends Processor> procSupplier,
int preferredLocalParallelism)
Factory method that wraps the given
Supplier<Processor>
and uses it as the supplier of all Processor instances. |
static ProcessorMetaSupplier |
of(ProcessorSupplier procSupplier)
Wraps the provided
ProcessorSupplier into a meta-supplier that
will always return it. |
static ProcessorMetaSupplier |
of(ProcessorSupplier procSupplier,
int preferredLocalParallelism)
Factory method that wraps the given
ProcessorSupplier and
returns the same instance for each given Address . |
default int |
preferredLocalParallelism()
Returns the local parallelism the vertex should be configured with.
|
default int preferredLocalParallelism()
Vertex.LOCAL_PARALLELISM_USE_DEFAULT
.default void init(@Nonnull ProcessorMetaSupplier.Context context)
@Nonnull java.util.function.Function<com.hazelcast.nio.Address,ProcessorSupplier> get(@Nonnull List<com.hazelcast.nio.Address> addresses)
Address
to the
ProcessorSupplier
that will be sent to that member. Jet calls
this method with a list of all cluster members' addresses and the
returned function must be a mapping that returns a non-null value for
each given address.
The method will be called once per job execution on the job's
coordinator member. init()
will have already
been called.
default void complete(Throwable error)
ProcessorSupplier.complete(Throwable)
has been called on all
available members.
If there is an exception during the creation of the execution plan, this
method will be called regardless of whether the init()
or get()
method have been called or not.
If you rely on the fact that this method is run once per cluster, it can happen that it is not called, if the coordinator member crashed.
error
- the exception (if any) that caused the job to fail;
null
in the case of successful job completion@Nonnull static ProcessorMetaSupplier of(@Nonnull ProcessorSupplier procSupplier, int preferredLocalParallelism)
ProcessorSupplier
and
returns the same instance for each given Address
.procSupplier
- the processor supplierpreferredLocalParallelism
- the value to return from preferredLocalParallelism()
static ProcessorMetaSupplier dontParallelize(ProcessorSupplier supplier)
ProcessorSupplier
into a meta-supplier that
will always return it. The preferredLocalParallelism()
of
the meta-supplier will be one, i.e., no local parallelization.@Nonnull static ProcessorMetaSupplier of(@Nonnull ProcessorSupplier procSupplier)
ProcessorSupplier
into a meta-supplier that
will always return it. The preferredLocalParallelism()
of
the meta-supplier will be Vertex.LOCAL_PARALLELISM_USE_DEFAULT
.@Nonnull static ProcessorMetaSupplier dontParallelize(@Nonnull DistributedSupplier<? extends Processor> procSupplier)
Supplier<Processor>
and uses it as the supplier of all Processor
instances.
Specifically, returns a meta-supplier that will always return the
result of calling ProcessorSupplier.of(DistributedSupplier)
.@Nonnull static ProcessorMetaSupplier of(@Nonnull DistributedSupplier<? extends Processor> procSupplier, int preferredLocalParallelism)
Supplier<Processor>
and uses it as the supplier of all Processor
instances.
Specifically, returns a meta-supplier that will always return the
result of calling ProcessorSupplier.of(DistributedSupplier)
.procSupplier
- the supplier of processorspreferredLocalParallelism
- the value to return from preferredLocalParallelism()
@Nonnull static ProcessorMetaSupplier of(@Nonnull DistributedSupplier<? extends Processor> procSupplier)
Supplier<Processor>
and uses it as the supplier of all Processor
instances.
Specifically, returns a meta-supplier that will always return the
result of calling ProcessorSupplier.of(DistributedSupplier)
.
The preferredLocalParallelism()
of the meta-supplier will be
Vertex.LOCAL_PARALLELISM_USE_DEFAULT
.static ProcessorMetaSupplier of(DistributedFunction<com.hazelcast.nio.Address,ProcessorSupplier> addressToSupplier, int preferredLocalParallelism)
ProcessorMetaSupplier
from the
supplied function that maps a cluster member address to a ProcessorSupplier
.addressToSupplier
- the mapping from address to ProcessorSupplierpreferredLocalParallelism
- the value to return from preferredLocalParallelism()
static ProcessorMetaSupplier of(DistributedFunction<com.hazelcast.nio.Address,ProcessorSupplier> addressToSupplier)
ProcessorMetaSupplier
from the
supplied function that maps a cluster member address to a ProcessorSupplier
. The preferredLocalParallelism()
of
the meta-supplier will be Vertex.LOCAL_PARALLELISM_USE_DEFAULT
.Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.