Class DiffableUtils.MapDiff<K,T,M>

java.lang.Object
org.opensearch.cluster.DiffableUtils.MapDiff<K,T,M>
Type Parameters:
K - the type of map keys
T - the type of map values
M - the map implementation type
All Implemented Interfaces:
Diff<M>, org.opensearch.core.common.io.stream.Writeable
Enclosing class:
DiffableUtils

public abstract static class DiffableUtils.MapDiff<K,T,M> extends Object implements Diff<M>
Represents differences between two maps of objects and is used as base class for different map implementations.

Implements serialization. How differences are applied is left to subclasses.

Opensearch.internal:
  • Field Details

  • Constructor Details

  • Method Details

    • getDeletes

      public List<K> getDeletes()
      The keys that, when this diff is applied to a map, should be removed from the map.
      Returns:
      the list of keys that are deleted
    • getDiffs

      public Map<K,Diff<T>> getDiffs()
      Map entries that, when this diff is applied to a map, should be incrementally updated. The incremental update is represented using the Diff interface.
      Returns:
      the map entries that are incrementally updated
    • getUpserts

      public Map<K,T> getUpserts()
      Map entries that, when this diff is applied to a map, should be added to the map or fully replace the previous value.
      Returns:
      the map entries that are additions or full updates
    • writeTo

      public void writeTo(org.opensearch.core.common.io.stream.StreamOutput out) throws IOException
      Specified by:
      writeTo in interface org.opensearch.core.common.io.stream.Writeable
      Throws:
      IOException