Module org.elasticsearch.server
Package org.elasticsearch.cluster
Class DiffableUtils.MapDiff<K,T,M extends Map<K,T>>
java.lang.Object
org.elasticsearch.cluster.DiffableUtils.MapDiff<K,T,M>
- Type Parameters:
K
- the type of map keysT
- the type of map values
- 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
Fields -
Method Summary
Modifier and TypeMethodDescriptionApplies difference to the specified part and returns the resulted partThe 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.boolean
isEmpty()
true
if this diff results in no changes to the mapvoid
writeTo
(StreamOutput out) Write this into the StreamOutput.
-
Field Details
-
deletes
-
diffs
-
upserts
-
keySerializer
-
valueSerializer
-
-
Method Details
-
apply
Description copied from interface:Diff
Applies difference to the specified part and returns the resulted part -
isEmpty
public boolean isEmpty()true
if this diff results in no changes to the map -
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
-