com.hazelcast.map.merge

## Interface MapMergePolicy

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

      public interface MapMergePolicy
      extends DataSerializable

  Policy for merging 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, EntryView mergingEntry, EntryView existingEntry)` Selects one of the merging and existing map entries to be merged.

    - ### Methods inherited from interface com.hazelcast.nio.serialization.DataSerializable

      `readData, writeData`

- - ### Method Detail

    - #### merge

          Object merge(String mapName,
                       EntryView mergingEntry,
                       EntryView 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 map
        `mergingEntry` - `EntryView` instance that has the map entry to be merged
        `existingEntry` - `EntryView` 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 © 2020. All rights reserved.