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(MergingValueHolder dataHolder,
Class<?> clazz) |
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
<V> V |
merge(MergingValueHolder<V> mergingValue,
MergingValueHolder<V> existingValue)
Selects the value of either the merging or the existing
MergingValueHolder 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(MergingValueHolder dataHolder, 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(MergingValueHolder<V> mergingValue, MergingValueHolder<V> existingValue)
SplitBrainMergePolicy
MergingValueHolder
which should be merged.
Note that the existing MergingValueHolder
instance may be null
if no matching data could be found to the merging MergingValueHolder
.
merge
in interface SplitBrainMergePolicy
V
- the type of the valuemergingValue
- MergingValueHolder
instance that has the merging data of the smaller sub-clusterexistingValue
- MergingValueHolder
instance that has the existing data
or null
if no matching data existsCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.