public final class LatestUpdateMapMergePolicy extends Object implements ReplicatedMapMergePolicy, IdentifiedDataSerializable
Note: This policy can only be used if the clocks of the nodes are in sync.
| Modifier and Type | Field and Description |
|---|---|
static LatestUpdateMapMergePolicy |
INSTANCE
Single instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
Object |
merge(String mapName,
ReplicatedMapEntryView mergingEntry,
ReplicatedMapEntryView existingEntry)
Selects one of the merging and existing map entries to be merged.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final LatestUpdateMapMergePolicy INSTANCE
public Object merge(String mapName, ReplicatedMapEntryView mergingEntry, ReplicatedMapEntryView existingEntry)
ReplicatedMapMergePolicy
Note that the existingEntry may be null if there
is no entry with the same key in the destination map.
This happens, when the entry for that key was
merge in interface ReplicatedMapMergePolicymapName - name of the replicated mapmergingEntry - ReplicatedMapEntryView instance that has the map entry to be mergedexistingEntry - ReplicatedMapEntryView instance that has the existing map entry
or null if there is no existing map entrynull if the entry should be removedpublic int getFactoryId()
IdentifiedDataSerializablegetFactoryId in interface IdentifiedDataSerializablepublic int getId()
IdentifiedDataSerializablegetId in interface IdentifiedDataSerializablepublic void writeData(ObjectDataOutput out)
DataSerializablewriteData in interface DataSerializableout - outputpublic void readData(ObjectDataInput in)
DataSerializablereadData in interface DataSerializablein - inputCopyright © 2020 Hazelcast, Inc.. All Rights Reserved.