Package com.hazelcast.config
Class MergePolicyConfig
java.lang.Object
com.hazelcast.config.MergePolicyConfig
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
Configuration for
SplitBrainMergePolicy
.-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default batch size.static final String
Default merge policy. -
Constructor Summary
ConstructorDescriptionMergePolicyConfig
(MergePolicyConfig mergePolicyConfig) MergePolicyConfig
(String policy, int batchSize) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
int
Returns the batch size, which will be used to determine the number of entries to be sent in a merge operation.int
Returns type identifier for this class.int
Returns DataSerializableFactory factory ID for this class.Returns the classname of theSplitBrainMergePolicy
.final int
hashCode()
void
Reads fields from the input streamsetBatchSize
(int batchSize) Sets the batch size, which will be used to determine the number of entries to be sent in a merge operation.Sets the classname of yourSplitBrainMergePolicy
.toString()
void
Writes object fields to output stream
-
Field Details
-
DEFAULT_MERGE_POLICY
Default merge policy. -
DEFAULT_BATCH_SIZE
public static final int DEFAULT_BATCH_SIZEDefault batch size.- See Also:
-
-
Constructor Details
-
MergePolicyConfig
public MergePolicyConfig() -
MergePolicyConfig
-
MergePolicyConfig
-
-
Method Details
-
getPolicy
Returns the classname of theSplitBrainMergePolicy
.- Returns:
- the classname of the merge policy
-
setPolicy
Sets the classname of yourSplitBrainMergePolicy
.For the out-of-the-box merge policies the simple classname is sufficient, e.g.
PutIfAbsentMergePolicy
. But also the fully qualified classname is fine, e.g. com.hazelcast.spi.merge.PutIfAbsentMergePolicy. For a custom merge policy the fully qualified classname is needed.Must be a non-empty string. The default value is
PutIfAbsentMergePolicy
.- Parameters:
policy
- the classname of the merge policy- Returns:
- this
MergePolicyConfig
instance
-
getBatchSize
public int getBatchSize()Returns the batch size, which will be used to determine the number of entries to be sent in a merge operation.- Returns:
- the batch size
-
setBatchSize
Sets the batch size, which will be used to determine the number of entries to be sent in a merge operation.Must be a positive number. Set to
1
to disable batching. The default value is 100.- Parameters:
batchSize
- the batch size- Returns:
- this
MergePolicyConfig
instance
-
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() -
toString
-