Package com.hazelcast.config
Class ScheduledExecutorConfig
- java.lang.Object
-
- com.hazelcast.config.ScheduledExecutorConfig
-
- All Implemented Interfaces:
NamedConfig
,DataSerializable
,IdentifiedDataSerializable
,com.hazelcast.nio.serialization.impl.Versioned
public class ScheduledExecutorConfig extends java.lang.Object implements IdentifiedDataSerializable, NamedConfig, com.hazelcast.nio.serialization.impl.Versioned
Configuration options for theIScheduledExecutorService
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ScheduledExecutorConfig.CapacityPolicy
Capacity policy options
-
Constructor Summary
Constructors Constructor Description ScheduledExecutorConfig()
ScheduledExecutorConfig(ScheduledExecutorConfig config)
ScheduledExecutorConfig(java.lang.String name)
ScheduledExecutorConfig(java.lang.String name, int durability, int capacity, int poolSize, boolean statisticsEnabled)
ScheduledExecutorConfig(java.lang.String name, int durability, int capacity, int poolSize, java.lang.String splitBrainProtectionName, MergePolicyConfig mergePolicyConfig, ScheduledExecutorConfig.CapacityPolicy capacityPolicy, boolean statisticsEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getCapacity()
Gets the capacity of the executorScheduledExecutorConfig.CapacityPolicy
getCapacityPolicy()
int
getClassId()
Returns type identifier for this class.int
getDurability()
Gets the durability of the executorint
getFactoryId()
Returns DataSerializableFactory factory ID for this class.MergePolicyConfig
getMergePolicyConfig()
Gets theMergePolicyConfig
for the scheduler.java.lang.String
getName()
Gets the name of the executor task.int
getPoolSize()
Gets the number of executor threads per member for the executor.java.lang.String
getSplitBrainProtectionName()
Returns the split brain protection name for operations.int
hashCode()
boolean
isStatisticsEnabled()
void
readData(ObjectDataInput in)
Reads fields from the input streamScheduledExecutorConfig
setCapacity(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.ScheduledExecutorConfig
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.ScheduledExecutorConfig
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.ScheduledExecutorConfig
setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
Sets theMergePolicyConfig
for the scheduler.ScheduledExecutorConfig
setName(java.lang.String name)
Sets the name of the executor task.ScheduledExecutorConfig
setPoolSize(int poolSize)
Sets the number of executor threads per member for the executor.ScheduledExecutorConfig
setSplitBrainProtectionName(java.lang.String splitBrainProtectionName)
Sets the split brain protection name for operations.ScheduledExecutorConfig
setStatisticsEnabled(boolean statisticsEnabled)
Enables or disables statistics gathering on the executor task.java.lang.String
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
-
-
Constructor Detail
-
ScheduledExecutorConfig
public ScheduledExecutorConfig()
-
ScheduledExecutorConfig
public ScheduledExecutorConfig(java.lang.String name)
-
ScheduledExecutorConfig
public ScheduledExecutorConfig(java.lang.String name, int durability, int capacity, int poolSize, boolean statisticsEnabled)
-
ScheduledExecutorConfig
public ScheduledExecutorConfig(java.lang.String name, int durability, int capacity, int poolSize, java.lang.String splitBrainProtectionName, MergePolicyConfig mergePolicyConfig, ScheduledExecutorConfig.CapacityPolicy capacityPolicy, boolean statisticsEnabled)
-
ScheduledExecutorConfig
public ScheduledExecutorConfig(ScheduledExecutorConfig config)
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the name of the executor task.- Specified by:
getName
in interfaceNamedConfig
- Returns:
- the name of the executor task
-
setName
public ScheduledExecutorConfig setName(java.lang.String name)
Sets the name of the executor task.- Specified by:
setName
in 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
public ScheduledExecutorConfig 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 ScheduledExecutorConfig 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. 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
public ScheduledExecutorConfig setCapacity(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. 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
public ScheduledExecutorConfig.CapacityPolicy 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
public java.lang.String getSplitBrainProtectionName()
Returns the split brain protection name for operations.- Returns:
- the split brain protection name
-
setSplitBrainProtectionName
public ScheduledExecutorConfig setSplitBrainProtectionName(java.lang.String splitBrainProtectionName)
Sets the split brain protection name for operations.- Parameters:
splitBrainProtectionName
- the split brain protection name- Returns:
- the updated configuration
-
getMergePolicyConfig
public MergePolicyConfig getMergePolicyConfig()
Gets theMergePolicyConfig
for the scheduler.- Returns:
- the
MergePolicyConfig
for the scheduler
-
setMergePolicyConfig
public ScheduledExecutorConfig setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
Sets theMergePolicyConfig
for the scheduler.- Returns:
- this executor config instance
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
- Returns:
true
if statistics gathering is enabled on the executor task (default),false
otherwise
-
setStatisticsEnabled
public ScheduledExecutorConfig 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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getFactoryId
public int getFactoryId()
Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- 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 interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
writeData
public void writeData(ObjectDataOutput out) throws java.io.IOException
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
public void readData(ObjectDataInput in) throws java.io.IOException
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-