Package com.hazelcast.config
Class MergePolicyConfig
java.lang.Object
com.hazelcast.config.MergePolicyConfig
- All Implemented Interfaces:
- DataSerializable,- IdentifiedDataSerializable
Configuration for 
SplitBrainMergePolicy.- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDefault batch size.static final StringDefault merge policy.
- 
Constructor SummaryConstructorsConstructorDescriptionMergePolicyConfig(MergePolicyConfig mergePolicyConfig) MergePolicyConfig(String policy, int batchSize) 
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanintReturns the batch size, which will be used to determine the number of entries to be sent in a merge operation.intReturns type identifier for this class.intReturns DataSerializableFactory factory ID for this class.Returns the classname of theSplitBrainMergePolicy.final inthashCode()voidReads 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()voidWrites object fields to output stream
- 
Field Details- 
DEFAULT_MERGE_POLICYDefault merge policy.
- 
DEFAULT_BATCH_SIZEpublic static final int DEFAULT_BATCH_SIZEDefault batch size.- See Also:
 
 
- 
- 
Constructor Details- 
MergePolicyConfigpublic MergePolicyConfig()
- 
MergePolicyConfig
- 
MergePolicyConfig
 
- 
- 
Method Details- 
getPolicyReturns the classname of theSplitBrainMergePolicy.- Returns:
- the classname of the merge policy
 
- 
setPolicySets 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 MergePolicyConfiginstance
 
- 
getBatchSizepublic 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
 
- 
setBatchSizeSets 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 1to disable batching. The default value is 100.- Parameters:
- batchSize- the batch size
- Returns:
- this MergePolicyConfiginstance
 
- 
getFactoryIdpublic int getFactoryId()Description copied from interface:IdentifiedDataSerializableReturns DataSerializableFactory factory ID for this class.- Specified by:
- getFactoryIdin interface- IdentifiedDataSerializable
- Returns:
- factory ID
 
- 
getClassIdpublic int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
- getClassIdin interface- IdentifiedDataSerializable
- Returns:
- type ID
 
- 
writeDataDescription copied from interface:DataSerializableWrites object fields to output stream- Specified by:
- writeDatain interface- DataSerializable
- Parameters:
- out- output
- Throws:
- IOException- if an I/O error occurs. In particular, an- IOExceptionmay be thrown if the output stream has been closed.
 
- 
readDataDescription copied from interface:DataSerializableReads fields from the input stream- Specified by:
- readDatain interface- DataSerializable
- Parameters:
- in- input
- Throws:
- IOException- if an I/O error occurs. In particular, an- IOExceptionmay be thrown if the input stream has been closed.
 
- 
equals
- 
hashCodepublic final int hashCode()
- 
toString
 
-