public abstract class AbstractSplitBrainMergePolicy extends Object implements SplitBrainMergePolicy, IdentifiedDataSerializable
SplitBrainMergePolicy
for the out-of-the-box merge policies.
Doesn't save the injected SerializationService
, since it's not needed by any out-of-the-box merge policy.
Constructor and Description |
---|
AbstractSplitBrainMergePolicy() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkInstanceOf(MergingValue mergingValue,
Class<?> clazz) |
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
<V> V |
merge(MergingValue<V> mergingValue,
MergingValue<V> existingValue)
Selects the value of either the merging or the existing
MergingValue which should be merged. |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId
protected void checkInstanceOf(MergingValue mergingValue, Class<?> clazz)
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out)
DataSerializable
writeData
in interface DataSerializable
out
- outputpublic void readData(ObjectDataInput in)
DataSerializable
readData
in interface DataSerializable
in
- inputpublic <V> V merge(MergingValue<V> mergingValue, MergingValue<V> existingValue)
SplitBrainMergePolicy
MergingValue
which should be merged.
Note that the existing MergingValue
instance may be null
if no matching data could be found to the merging MergingValue
.
merge
in interface SplitBrainMergePolicy
V
- the type of the valuemergingValue
- MergingValue
instance that has the merging data of the smaller sub-clusterexistingValue
- MergingValue
instance that has the existing data
or null
if no matching data existsCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.