Package com.hazelcast.config
Class DurableExecutorConfig
- java.lang.Object
-
- com.hazelcast.config.DurableExecutorConfig
-
- All Implemented Interfaces:
NamedConfig
,DataSerializable
,IdentifiedDataSerializable
,com.hazelcast.nio.serialization.impl.Versioned
public class DurableExecutorConfig extends java.lang.Object implements IdentifiedDataSerializable, NamedConfig, com.hazelcast.nio.serialization.impl.Versioned
Contains the configuration for anDurableExecutorService
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_DURABILITY
Durability of Executor.static int
DEFAULT_POOL_SIZE
The number of executor threads per Member for the Executor based on this configuration.static int
DEFAULT_RING_BUFFER_CAPACITY
Capacity of RingBuffer (per partition).
-
Constructor Summary
Constructors Constructor Description DurableExecutorConfig()
DurableExecutorConfig(DurableExecutorConfig config)
DurableExecutorConfig(java.lang.String name)
DurableExecutorConfig(java.lang.String name, int poolSize, int durability, int capacity, boolean statisticsEnabled)
DurableExecutorConfig(java.lang.String name, int poolSize, int durability, int capacity, java.lang.String splitBrainProtectionName, 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 ring buffer capacity of the executor task.int
getClassId()
Returns type identifier for this class.int
getDurability()
Gets the durability of the executorint
getFactoryId()
Returns DataSerializableFactory factory ID for this class.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 streamDurableExecutorConfig
setCapacity(int capacity)
Sets the ring buffer capacity of the executor task.DurableExecutorConfig
setDurability(int durability)
Sets the durability of the executorDurableExecutorConfig
setName(java.lang.String name)
Sets the name of the executor task.DurableExecutorConfig
setPoolSize(int poolSize)
Sets the number of executor threads per member for the executor.DurableExecutorConfig
setSplitBrainProtectionName(java.lang.String splitBrainProtectionName)
Sets the split brain protection name for operations.DurableExecutorConfig
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
-
-
-
Field Detail
-
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:
- Constant Field Values
-
DEFAULT_RING_BUFFER_CAPACITY
public static final int DEFAULT_RING_BUFFER_CAPACITY
Capacity of RingBuffer (per partition).- See Also:
- Constant Field Values
-
DEFAULT_DURABILITY
public static final int DEFAULT_DURABILITY
Durability of Executor.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DurableExecutorConfig
public DurableExecutorConfig()
-
DurableExecutorConfig
public DurableExecutorConfig(java.lang.String name)
-
DurableExecutorConfig
public DurableExecutorConfig(java.lang.String name, int poolSize, int durability, int capacity, boolean statisticsEnabled)
-
DurableExecutorConfig
public DurableExecutorConfig(java.lang.String name, int poolSize, int durability, int capacity, java.lang.String splitBrainProtectionName, boolean statisticsEnabled)
-
DurableExecutorConfig
public DurableExecutorConfig(DurableExecutorConfig 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 DurableExecutorConfig 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 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 java.lang.String getSplitBrainProtectionName()
Returns the split brain protection name for operations.- Returns:
- the split brain protection name
-
setSplitBrainProtectionName
public DurableExecutorConfig setSplitBrainProtectionName(java.lang.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
-
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
-
-