com.hazelcast.replicatedmap.merge

## Interface ReplicatedMapMergePolicy

- All Superinterfaces:
    Serializable
  All Known Implementing Classes:
    HigherHitsMapMergePolicy, LatestUpdateMapMergePolicy, PassThroughMergePolicy, PutIfAbsentMapMergePolicy

      public interface ReplicatedMapMergePolicy
      extends Serializable

  Policy for merging replicated map entries after a split-brain has been healed.
  See Also:
    `HigherHitsMapMergePolicy`, `LatestUpdateMapMergePolicy`, `PassThroughMergePolicy`, `PutIfAbsentMapMergePolicy`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `merge(String mapName, com.hazelcast.replicatedmap.impl.record.ReplicatedMapEntryView mergingEntry, com.hazelcast.replicatedmap.impl.record.ReplicatedMapEntryView existingEntry)` Selects one of the merging and existing map entries to be merged.

- - ### Method Detail

    - #### merge

          Object merge(String mapName,
                       com.hazelcast.replicatedmap.impl.record.ReplicatedMapEntryView mergingEntry,
                       com.hazelcast.replicatedmap.impl.record.ReplicatedMapEntryView existingEntry)

      Selects one of the merging and existing map entries to be merged.

      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

      - only created in the smaller sub-cluster during the split-brain
      - removed in the larger sub-cluster during the split-brain
      Parameters:
        `mapName` - name of the replicated map
        `mergingEntry` - `ReplicatedMapEntryView` instance that has the map entry to be merged
        `existingEntry` - `ReplicatedMapEntryView` instance that has the existing map entry or `null` if there is no existing map entry
      Returns:
        the selected value for merging or `null` if the entry should be removed

Copyright © 2019. All rights reserved.