Package com.hazelcast.config
Class ExecutorConfig
java.lang.Object
com.hazelcast.config.ExecutorConfig
- All Implemented Interfaces:
NamedConfig
,DataSerializable
,IdentifiedDataSerializable
public class ExecutorConfig extends Object implements IdentifiedDataSerializable, NamedConfig
Contains the configuration for an
IExecutorService
.-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_POOL_SIZE
The number of executor threads per Member for the Executor based on this configuration.static int
DEFAULT_QUEUE_CAPACITY
Capacity of queue. -
Constructor Summary
Constructors Constructor Description ExecutorConfig()
ExecutorConfig(ExecutorConfig config)
ExecutorConfig(String name)
ExecutorConfig(String name, int poolSize)
-
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
int
getClassId()
Returns type identifier for this class.int
getFactoryId()
Returns DataSerializableFactory factory ID for this class.String
getName()
Gets the name of the executor task.int
getPoolSize()
Gets the number of executor threads per member for the executor.int
getQueueCapacity()
Gets the queue capacity of the executor task.String
getSplitBrainProtectionName()
Returns the split brain protection name for operations.int
hashCode()
boolean
isStatisticsEnabled()
void
readData(ObjectDataInput in)
Reads fields from the input streamExecutorConfig
setName(String name)
Sets the name of the executor task.ExecutorConfig
setPoolSize(int poolSize)
Sets the number of executor threads per member for the executor.ExecutorConfig
setQueueCapacity(int queueCapacity)
Sets the queue capacity of the executor task.ExecutorConfig
setSplitBrainProtectionName(String splitBrainProtectionName)
Sets the split brain protection name for operations.ExecutorConfig
setStatisticsEnabled(boolean statisticsEnabled)
Enables or disables statistics gathering on the executor task.String
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
Field Details
-
DEFAULT_POOL_SIZE
public static final int DEFAULT_POOL_SIZEThe number of executor threads per Member for the Executor based on this configuration.- See Also:
- Constant Field Values
-
DEFAULT_QUEUE_CAPACITY
public static final int DEFAULT_QUEUE_CAPACITYCapacity of queue.- See Also:
- Constant Field Values
-
-
Constructor Details
-
ExecutorConfig
public ExecutorConfig() -
ExecutorConfig
-
ExecutorConfig
-
ExecutorConfig
-
-
Method Details
-
getName
Gets the name of the executor task.- Specified by:
getName
in interfaceNamedConfig
- Returns:
- the name of the executor task
-
setName
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
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
-
getQueueCapacity
public int getQueueCapacity()Gets the queue capacity of the executor task. 0 meansInteger.MAX_VALUE
.- Returns:
- Queue capacity of the executor task. 0 means
Integer.MAX_VALUE
-
setQueueCapacity
Sets the queue capacity of the executor task. 0 meansInteger.MAX_VALUE
.- Parameters:
queueCapacity
- Queue capacity of the executor task. 0 meansInteger.MAX_VALUE
- Returns:
- this executor config instance
-
isStatisticsEnabled
public boolean isStatisticsEnabled()- Returns:
true
if statistics gathering is enabled on the executor task (default),false
otherwise
-
setStatisticsEnabled
Enables or disables statistics gathering on the executor task.- Parameters:
statisticsEnabled
-true
if statistics gathering is enabled on the executor task,false
otherwise- Returns:
- this executor config instance
-
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
-
toString
-
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
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
-
hashCode
public final int hashCode()
-