Class DurableExecutorConfig

java.lang.Object
com.hazelcast.config.DurableExecutorConfig
All Implemented Interfaces:
NamedConfig, UserCodeNamespaceAwareConfig<DurableExecutorConfig>, DataSerializable, IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned

public class DurableExecutorConfig extends Object implements IdentifiedDataSerializable, NamedConfig, com.hazelcast.nio.serialization.impl.Versioned, UserCodeNamespaceAwareConfig<DurableExecutorConfig>
Contains the configuration for an DurableExecutorService.
  • Field Details

    • DEFAULT_POOL_SIZE

      public static final int DEFAULT_POOL_SIZE
      The number of executor threads per Member for the Executor based on this configuration.
      See Also:
    • DEFAULT_RING_BUFFER_CAPACITY

      public static final int DEFAULT_RING_BUFFER_CAPACITY
      Capacity of RingBuffer (per partition).
      See Also:
    • DEFAULT_DURABILITY

      public static final int DEFAULT_DURABILITY
      Durability of Executor.
      See Also:
  • Constructor Details

    • DurableExecutorConfig

      public DurableExecutorConfig()
    • DurableExecutorConfig

      public DurableExecutorConfig(String name)
    • DurableExecutorConfig

      public DurableExecutorConfig(String name, int poolSize, int durability, int capacity, boolean statisticsEnabled, @Nullable String userCodeNamespace)
    • DurableExecutorConfig

      public DurableExecutorConfig(String name, int poolSize, int durability, int capacity, String splitBrainProtectionName, boolean statisticsEnabled, @Nullable String userCodeNamespace)
    • DurableExecutorConfig

      public DurableExecutorConfig(DurableExecutorConfig config)
  • Method Details

    • getName

      public String getName()
      Gets the name of the executor task.
      Specified by:
      getName in interface NamedConfig
      Returns:
      the name of the executor task
    • setName

      public DurableExecutorConfig setName(String name)
      Sets the name of the executor task.
      Specified by:
      setName in interface NamedConfig
      Parameters:
      name - the name of the executor task
      Returns:
      this executor config instance
    • getPoolSize

      public int getPoolSize()
      Gets the number of executor threads per member for the executor.
      Returns:
      the number of executor threads per member for the executor
    • setPoolSize

      public DurableExecutorConfig setPoolSize(int poolSize)
      Sets the number of executor threads per member for the executor.
      Parameters:
      poolSize - the number of executor threads per member for the executor
      Returns:
      this executor config instance
    • getDurability

      public int getDurability()
      Gets the durability of the executor
      Returns:
      the durability of the executor
    • setDurability

      public DurableExecutorConfig setDurability(int durability)
      Sets the durability of the executor
      Parameters:
      durability - the durability of the executor
      Returns:
      this executor config instance
    • getCapacity

      public int getCapacity()
      Gets the ring buffer capacity of the executor task. This is a per partition parameter, so total capacity of the ringbuffers will be partitionCount * capacity
      Returns:
      Ring buffer capacity of the executor task
    • setCapacity

      public DurableExecutorConfig setCapacity(int capacity)
      Sets the ring buffer capacity of the executor task.
      Parameters:
      capacity - Ring Buffer capacity of the executor task
      Returns:
      this executor config instance
    • getSplitBrainProtectionName

      public String getSplitBrainProtectionName()
      Returns the split brain protection name for operations.
      Returns:
      the split brain protection name
    • setSplitBrainProtectionName

      public DurableExecutorConfig setSplitBrainProtectionName(String splitBrainProtectionName)
      Sets the split brain protection name for operations.
      Parameters:
      splitBrainProtectionName - the split brain protection name
      Returns:
      the updated configuration
    • isStatisticsEnabled

      public boolean isStatisticsEnabled()
      Returns:
      true if statistics gathering is enabled on the executor task (default), false otherwise
    • setStatisticsEnabled

      public DurableExecutorConfig setStatisticsEnabled(boolean statisticsEnabled)
      Enables or disables statistics gathering on the executor task.
      Parameters:
      statisticsEnabled - true if statistics gathering is enabled on the executor task, false otherwise @return this executor config instance
    • getUserCodeNamespace

      @Nullable public String getUserCodeNamespace()
      Retrieve the User Code Deployment Namespace to be used for ClassLoader awareness during operations related to the structure associated with this configuration.
      Specified by:
      getUserCodeNamespace in interface UserCodeNamespaceAwareConfig<DurableExecutorConfig>
      Returns:
      Namespace Name for use with the UserCodeNamespaceService, or null if there is no User Code Namespace to associate with.
    • setUserCodeNamespace

      public DurableExecutorConfig setUserCodeNamespace(@Nullable String userCodeNamespace)
      Associates the provided Namespace Name with this structure for ClassLoader awareness.

      The behaviour of setting this to null is outlined in the documentation for UserCodeNamespaceAwareConfig.DEFAULT_NAMESPACE.

      Specified by:
      setUserCodeNamespace in interface UserCodeNamespaceAwareConfig<DurableExecutorConfig>
      Parameters:
      userCodeNamespace - The ID of the Namespace to associate with this structure.
      Returns:
      the updated DurableExecutorConfig instance
      Since:
      5.4
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getFactoryId

      public int getFactoryId()
      Description copied from interface: IdentifiedDataSerializable
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
      getFactoryId in interface IdentifiedDataSerializable
      Returns:
      factory ID
    • getClassId

      public int getClassId()
      Description copied from interface: IdentifiedDataSerializable
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
      getClassId in interface IdentifiedDataSerializable
      Returns:
      type ID
    • writeData

      public void writeData(ObjectDataOutput out) throws IOException
      Description copied from interface: DataSerializable
      Writes object fields to output stream
      Specified by:
      writeData in interface DataSerializable
      Parameters:
      out - output
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
    • readData

      public void readData(ObjectDataInput in) throws IOException
      Description copied from interface: DataSerializable
      Reads fields from the input stream
      Specified by:
      readData in interface DataSerializable
      Parameters:
      in - input
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the input stream has been closed.
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object