Package org.elasticsearch.cluster
Class DiffableUtils.MapDiff<K,T,M>
java.lang.Object
org.elasticsearch.cluster.DiffableUtils.MapDiff<K,T,M>
- Type Parameters:
K
- the type of map keysT
- the type of map valuesM
- the map implementation type
- Direct Known Subclasses:
DiffableUtils.ImmutableOpenMapDiff
- Enclosing class:
- DiffableUtils
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final DiffableUtils.KeySerializer<K>
protected final DiffableUtils.ValueSerializer<K,
T> -
Constructor Summary
ModifierConstructorDescriptionprotected
MapDiff
(DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K, T> valueSerializer) protected
MapDiff
(DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K, T> valueSerializer, List<K> deletes, Map<K, Diff<T>> diffs, Map<K, T> upserts) protected
MapDiff
(StreamInput in, DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K, T> valueSerializer) -
Method Summary
Modifier and TypeMethodDescriptionThe keys that, when this diff is applied to a map, should be removed from the map.getDiffs()
Map entries that, when this diff is applied to a map, should be incrementally updated.Map entries that, when this diff is applied to a map, should be added to the map or fully replace the previous value.void
writeTo
(StreamOutput out) Write this into the StreamOutput.
-
Field Details
-
deletes
-
diffs
-
upserts
-
keySerializer
-
valueSerializer
-
-
Constructor Details
-
MapDiff
protected MapDiff(DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K, T> valueSerializer) -
MapDiff
-
MapDiff
protected MapDiff(StreamInput in, DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K, T> valueSerializer) throws IOException- Throws:
IOException
-
-
Method Details
-
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
Map entries that, when this diff is applied to a map, should be incrementally updated. The incremental update is represented using theDiff
interface.- Returns:
- the map entries that are incrementally updated
-
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
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-