Package com.hazelcast.config
Class ScheduledExecutorConfig
java.lang.Object
com.hazelcast.config.ScheduledExecutorConfig
- All Implemented Interfaces:
NamedConfig,UserCodeNamespaceAwareConfig<ScheduledExecutorConfig>,DataSerializable,IdentifiedDataSerializable,com.hazelcast.nio.serialization.impl.Versioned
public class ScheduledExecutorConfig
extends Object
implements IdentifiedDataSerializable, NamedConfig, com.hazelcast.nio.serialization.impl.Versioned, UserCodeNamespaceAwareConfig<ScheduledExecutorConfig>
Configuration options for the
IScheduledExecutorService.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCapacity policy options -
Field Summary
Fields inherited from interface com.hazelcast.config.UserCodeNamespaceAwareConfig
DEFAULT_NAMESPACE -
Constructor Summary
ConstructorsConstructorDescriptionScheduledExecutorConfig(String name, int durability, int capacity, int poolSize, boolean statisticsEnabled, String userCodeNamespace) ScheduledExecutorConfig(String name, int durability, int capacity, int poolSize, String splitBrainProtectionName, MergePolicyConfig mergePolicyConfig, ScheduledExecutorConfig.CapacityPolicy capacityPolicy, boolean statisticsEnabled, String userCodeNamespace) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanintGets the capacity of the executorintReturns type identifier for this class.intGets the durability of the executorintReturns DataSerializableFactory factory ID for this class.Gets theMergePolicyConfigfor the scheduler.getName()Gets the name of the executor task.intGets the number of executor threads per member for the executor.Returns the split brain protection name for operations.Retrieve the User Code Deployment Namespace to be used forClassLoaderawareness during operations related to the structure associated with this configuration.final inthashCode()booleanvoidReads fields from the input streamsetCapacity(int capacity) Sets the capacity of the executor The capacity represents the maximum number of tasks that a scheduler can have at any given point in time per partition or per node according to the capacity policy.setCapacityPolicy(ScheduledExecutorConfig.CapacityPolicy capacityPolicy) Set the capacity policy for the configured capacity value To prevent any undesirable data-loss, capacity is ignored during partition migrations, the count is updated accordingly, however the rejection is not enforced.setDurability(int durability) Sets the durability of the executor The durability represents the number of replicas that exist in a cluster for any given partition-owned task.setMergePolicyConfig(MergePolicyConfig mergePolicyConfig) Sets theMergePolicyConfigfor the scheduler.Sets the name of the executor task.setPoolSize(int poolSize) Sets the number of executor threads per member for the executor.setSplitBrainProtectionName(String splitBrainProtectionName) Sets the split brain protection name for operations.setStatisticsEnabled(boolean statisticsEnabled) Enables or disables statistics gathering on the executor task.setUserCodeNamespace(String userCodeNamespace) Associates the provided Namespace Name with this structure forClassLoaderawareness.toString()voidWrites object fields to output stream
-
Constructor Details
-
ScheduledExecutorConfig
public ScheduledExecutorConfig() -
ScheduledExecutorConfig
-
ScheduledExecutorConfig
-
ScheduledExecutorConfig
public ScheduledExecutorConfig(String name, int durability, int capacity, int poolSize, String splitBrainProtectionName, MergePolicyConfig mergePolicyConfig, ScheduledExecutorConfig.CapacityPolicy capacityPolicy, boolean statisticsEnabled, @Nullable String userCodeNamespace) -
ScheduledExecutorConfig
-
-
Method Details
-
getName
Gets the name of the executor task.- Specified by:
getNamein interfaceNamedConfig- Returns:
- the name of the executor task
-
setName
Sets the name of the executor task.- Specified by:
setNamein interfaceNamedConfig- 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
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
Sets the durability of the executor The durability represents the number of replicas that exist in a cluster for any given partition-owned task. If this is set to 0 then there is only 1 copy of the task in the cluster, meaning that if the partition owning it, goes down then the task is lost.- Parameters:
durability- the durability of the executor- Returns:
- this executor config instance
-
getCapacity
public int getCapacity()Gets the capacity of the executor- Returns:
- the capacity of the executor
-
setCapacity
Sets the capacity of the executor The capacity represents the maximum number of tasks that a scheduler can have at any given point in time per partition or per node according to the capacity policy. If this is set to 0 then there is no limit To prevent any undesirable data-loss, capacity is ignored during partition migrations, the count is updated accordingly, however the rejection is not enforced.- Parameters:
capacity- the capacity of the executor- Returns:
- this executor config instance
-
getCapacityPolicy
- Returns:
- the policy of the capacity setting
-
setCapacityPolicy
public ScheduledExecutorConfig setCapacityPolicy(@Nonnull ScheduledExecutorConfig.CapacityPolicy capacityPolicy) Set the capacity policy for the configured capacity value To prevent any undesirable data-loss, capacity is ignored during partition migrations, the count is updated accordingly, however the rejection is not enforced.- Parameters:
capacityPolicy-
-
getSplitBrainProtectionName
Returns the split brain protection name for operations.- Returns:
- the split brain protection name
-
setSplitBrainProtectionName
Sets the split brain protection name for operations.- Parameters:
splitBrainProtectionName- the split brain protection name- Returns:
- the updated configuration
-
getMergePolicyConfig
Gets theMergePolicyConfigfor the scheduler.- Returns:
- the
MergePolicyConfigfor the scheduler
-
setMergePolicyConfig
Sets theMergePolicyConfigfor the scheduler.- Returns:
- this executor config instance
-
isStatisticsEnabled
public boolean isStatisticsEnabled()- Returns:
trueif statistics gathering is enabled on the executor task (default),falseotherwise
-
setStatisticsEnabled
Enables or disables statistics gathering on the executor task.- Parameters:
statisticsEnabled-trueif statistics gathering is enabled on the executor task,falseotherwise @return this executor config instance
-
getUserCodeNamespace
Retrieve the User Code Deployment Namespace to be used forClassLoaderawareness during operations related to the structure associated with this configuration.- Specified by:
getUserCodeNamespacein interfaceUserCodeNamespaceAwareConfig<ScheduledExecutorConfig>- Returns:
- Namespace Name for use with the
UserCodeNamespaceService, ornullif there is no User Code Namespace to associate with.
-
setUserCodeNamespace
Associates the provided Namespace Name with this structure forClassLoaderawareness.The behaviour of setting this to
nullis outlined in the documentation forUserCodeNamespaceAwareConfig.DEFAULT_NAMESPACE.- Specified by:
setUserCodeNamespacein interfaceUserCodeNamespaceAwareConfig<ScheduledExecutorConfig>- Parameters:
userCodeNamespace- The ID of the Namespace to associate with this structure.- Returns:
- the updated
ScheduledExecutorConfiginstance - Since:
- 5.4
-
toString
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializableReturns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryIdin interfaceIdentifiedDataSerializable- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassIdin interfaceIdentifiedDataSerializable- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializableWrites object fields to output stream- Specified by:
writeDatain interfaceDataSerializable- Parameters:
out- output- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializableReads fields from the input stream- Specified by:
readDatain interfaceDataSerializable- Parameters:
in- input- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the input stream has been closed.
-
equals
-
hashCode
public final int hashCode()
-