Package com.hazelcast.spi.merge
Class LatestAccessMergePolicy<V,T extends MergingValue<V> & MergingLastAccessTime>
java.lang.Object
com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy<V,T,Object>
com.hazelcast.spi.merge.LatestAccessMergePolicy<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, Object>
public class LatestAccessMergePolicy<V,T extends MergingValue<V> & MergingLastAccessTime>
extends com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy<V,T,Object>
Merges data structure entries from source to destination data structure if the source entry
has been accessed more recently than the destination entry.
Note: This policy can only be used if the clocks of the nodes are in sync.
- Since:
- 3.10
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns type identifier for this class.Selects the value of either the merging or the existingMergingValue
which should be merged.Methods inherited from class com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy
getFactoryId, readData, writeData
-
Constructor Details
-
LatestAccessMergePolicy
public LatestAccessMergePolicy()
-
-
Method Details
-
merge
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
-