public class MergePolicyConfig extends Object implements IdentifiedDataSerializable
SplitBrainMergePolicy
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BATCH_SIZE
Default batch size.
|
static String |
DEFAULT_MERGE_POLICY
Default merge policy.
|
Constructor and Description |
---|
MergePolicyConfig() |
MergePolicyConfig(MergePolicyConfig mergePolicyConfig) |
MergePolicyConfig(String policy,
int batchSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
MergePolicyConfig |
getAsReadOnly()
Deprecated.
this method will be removed in 4.0; it is meant for internal usage only
|
int |
getBatchSize()
Returns the batch size, which will be used to determine the number of entries to be sent in a merge operation.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
String |
getPolicy()
Returns the classname of the
SplitBrainMergePolicy . |
int |
hashCode() |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
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.
|
MergePolicyConfig |
setPolicy(String policy)
Sets the classname of your
SplitBrainMergePolicy . |
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final String DEFAULT_MERGE_POLICY
public static final int DEFAULT_BATCH_SIZE
public MergePolicyConfig()
public MergePolicyConfig(String policy, int batchSize)
public MergePolicyConfig(MergePolicyConfig mergePolicyConfig)
public String getPolicy()
SplitBrainMergePolicy
.public MergePolicyConfig setPolicy(String policy)
SplitBrainMergePolicy
.
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
.
policy
- the classname of the merge policyMergePolicyConfig
instancepublic int getBatchSize()
public MergePolicyConfig setBatchSize(int batchSize)
Must be a positive number. Set to 1
to disable batching. The default value is 100.
batchSize
- the batch sizeMergePolicyConfig
instancepublic int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.public MergePolicyConfig getAsReadOnly()
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.