Package com.hazelcast.spi.merge
Class PutIfAbsentMergePolicy<V,T extends MergingValue<V>>
- java.lang.Object
-
- com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy<V,T,java.lang.Object>
-
- com.hazelcast.spi.merge.PutIfAbsentMergePolicy<V,T>
-
- Type Parameters:
V
- the type of the merged valueT
- the type of the merging value
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
,SplitBrainMergePolicy<V,T,java.lang.Object>
public class PutIfAbsentMergePolicy<V,T extends MergingValue<V>> extends com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy<V,T,java.lang.Object>
Merges data structure entries from source to destination if they don't exist in the destination data structure.- Since:
- 3.10
-
-
Constructor Summary
Constructors Constructor Description PutIfAbsentMergePolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getClassId()
Returns type identifier for this class.java.lang.Object
merge(T mergingValue, T existingValue)
Selects the value of either the merging or the existingMergingValue
which should be merged.
-
-
-
Method Detail
-
merge
public java.lang.Object merge(T mergingValue, T existingValue)
Description copied from interface:SplitBrainMergePolicy
Selects the value of either the merging or the existingMergingValue
which should be merged.Note that the existing
MergingValue
instance may benull
if no matching data could be found to the mergingMergingValue
.- Parameters:
mergingValue
-MergingValue
instance that has the merging data of the smaller sub-clusterexistingValue
-MergingValue
instance that has the existing data ornull
if no matching data exists- Returns:
- the selected value for merging
-
getClassId
public int getClassId()
Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Returns:
- type ID
-
-