Package com.hazelcast.config
Class MergePolicyConfig
- java.lang.Object
-
- com.hazelcast.config.MergePolicyConfig
-
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
public class MergePolicyConfig extends java.lang.Object implements IdentifiedDataSerializable
Configuration forSplitBrainMergePolicy
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_BATCH_SIZE
Default batch size.static java.lang.String
DEFAULT_MERGE_POLICY
Default merge policy.
-
Constructor Summary
Constructors Constructor Description MergePolicyConfig()
MergePolicyConfig(MergePolicyConfig mergePolicyConfig)
MergePolicyConfig(java.lang.String policy, int batchSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getBatchSize()
Returns the batch size, which will be used to determine the number of entries to be sent in a merge operation.int
getClassId()
Returns type identifier for this class.int
getFactoryId()
Returns DataSerializableFactory factory ID for this class.java.lang.String
getPolicy()
Returns the classname of theSplitBrainMergePolicy
.int
hashCode()
void
readData(ObjectDataInput in)
Reads fields from the input streamMergePolicyConfig
setBatchSize(int batchSize)
Sets the batch size, which will be used to determine the number of entries to be sent in a merge operation.MergePolicyConfig
setPolicy(java.lang.String policy)
Sets the classname of yourSplitBrainMergePolicy
.java.lang.String
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
-
-
Field Detail
-
DEFAULT_MERGE_POLICY
public static final java.lang.String DEFAULT_MERGE_POLICY
Default merge policy.
-
DEFAULT_BATCH_SIZE
public static final int DEFAULT_BATCH_SIZE
Default batch size.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MergePolicyConfig
public MergePolicyConfig()
-
MergePolicyConfig
public MergePolicyConfig(java.lang.String policy, int batchSize)
-
MergePolicyConfig
public MergePolicyConfig(MergePolicyConfig mergePolicyConfig)
-
-
Method Detail
-
getPolicy
public java.lang.String getPolicy()
Returns the classname of theSplitBrainMergePolicy
.- Returns:
- the classname of the merge policy
-
setPolicy
public MergePolicyConfig setPolicy(java.lang.String policy)
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
public MergePolicyConfig setBatchSize(int batchSize)
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
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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-