Package com.hazelcast.config
Class MergePolicyConfig
java.lang.Object
com.hazelcast.config.MergePolicyConfig
- All Implemented Interfaces:
DataSerializable,IdentifiedDataSerializable
Configuration for
SplitBrainMergePolicy.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault batch size.static final StringDefault merge policy. -
Constructor Summary
ConstructorsConstructorDescriptionMergePolicyConfig(MergePolicyConfig mergePolicyConfig) MergePolicyConfig(String policy, int batchSize) -
Method Summary
Modifier 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 class name 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 class name of yourSplitBrainMergePolicy.toString()voidWrites 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 class name of theSplitBrainMergePolicy.- Returns:
- the class name of the merge policy
-
setPolicy
Sets the class name of yourSplitBrainMergePolicy.For the out-of-the-box merge policies the simple class name is sufficient, e.g.
PutIfAbsentMergePolicy. But also the fully qualified class name is fine, e.g. com.hazelcast.spi.merge.PutIfAbsentMergePolicy. For a custom merge policy the fully qualified class name is needed.Must be a non-empty string. The default value is
PutIfAbsentMergePolicy.- Parameters:
policy- the class name of the merge policy- Returns:
- this
MergePolicyConfiginstance
-
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
1to disable batching. The default value is 100.- Parameters:
batchSize- the batch size- Returns:
- this
MergePolicyConfiginstance
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializableReturns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryIdin interfaceIdentifiedDataSerializable- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassIdin interfaceIdentifiedDataSerializable- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializableWrites object fields to output stream- Specified by:
writeDatain interfaceDataSerializable- Parameters:
out- output- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializableReads fields from the input stream- Specified by:
readDatain interfaceDataSerializable- Parameters:
in- input- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the input stream has been closed.
-
equals
-
hashCode
public final int hashCode() -
toString
-