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

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Context passed to the supplier in the init() call.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Called after the execution has finished on this member - successfully or not.
    default boolean
    Returns true if the close(Throwable) method of this instance is cooperative.
    get(int count)
    Called after init(Context) to retrieve instances of Processor that will be used during the execution of the Jet job.
    default void
    Called on each cluster member after deserialization.
    default boolean
    Returns true if the init(Context) method of this instance is cooperative.
    of(SupplierEx<? extends Processor> processorSupplier)
    Returns a ProcessorSupplier which will delegate to the given Supplier<Processor> to create all Processor instances.

    Methods inherited from interface com.hazelcast.security.impl.function.SecuredFunction

    permissions
  • Method Details

    • init

      default void init(@Nonnull ProcessorSupplier.Context context) throws Exception
      Called on each cluster member after deserialization.
      Throws:
      Exception
    • initIsCooperative

      default boolean initIsCooperative()
      Returns true if the init(Context) method of this instance is cooperative. If it's not, the call to the init() method is off-loaded to another thread.
      Since:
      5.2
    • get

      @Nonnull Collection<? extends Processor> get(int count)
      Called after init(Context) to retrieve instances of Processor 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 to ProcessorMetaSupplier.Context.localParallelism().
    • closeIsCooperative

      default boolean closeIsCooperative()
      Returns true if the close(Throwable) method of this instance is cooperative. If it's not, the call to the close() method is off-loaded to another thread.
      Since:
      5.2
    • close

      default void close(@Nullable Throwable error) throws Exception
      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 after Processor.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() or get() 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

      @Nonnull static ProcessorSupplier of(@Nonnull SupplierEx<? extends Processor> processorSupplier)
      Returns a ProcessorSupplier which will delegate to the given Supplier<Processor> to create all Processor instances.