Class LatestUpdateMergePolicy<V,​T extends MergingValue<V> & MergingLastUpdateTime>

Type Parameters:
V - the type of the merged value
T - the type of the merging value
All Implemented Interfaces:
DataSerializable, IdentifiedDataSerializable, SplitBrainMergePolicy<V,​T,​Object>

public class LatestUpdateMergePolicy<V,​T extends MergingValue<V> & MergingLastUpdateTime>
extends com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy<V,​T,​Object>
Merges data structure entries from source to destination data structure if the source entry was updated more frequently than the destination entry.

Note: This policy can only be used if the clocks of the nodes are in sync.

  • Constructor Details

  • Method Details

    • merge

      public Object merge​(T mergingValue, T existingValue)
      Description copied from interface: SplitBrainMergePolicy
      Selects the value of either the merging or the existing MergingValue which should be merged.

      Note that the existing MergingValue instance may be null if no matching data could be found to the merging MergingValue.

      mergingValue - MergingValue instance that has the merging data of the smaller sub-cluster
      existingValue - MergingValue instance that has the existing data or null if no matching data exists
      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.
      type ID