Package org.elasticsearch.cluster
Class DiffableUtils
- java.lang.Object
-
- org.elasticsearch.cluster.DiffableUtils
-
public final class DiffableUtils extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDiffableUtils.DiffableValueReader<K,V extends Diffable<V>>Implementation of the ValueSerializer that wraps value and diff readers.static classDiffableUtils.DiffableValueSerializer<K,V extends Diffable<V>>Serializer for Diffable map values.static classDiffableUtils.ImmutableOpenMapDiff<K,T>Represents differences between two ImmutableOpenMap of (possibly diffable) objectsstatic interfaceDiffableUtils.KeySerializer<K>Provides read and write operations to serialize keys of mapstatic classDiffableUtils.MapDiff<K,T,M>Represents differences between two maps of objects and is used as base class for different map implementations.static classDiffableUtils.NonDiffableValueSerializer<K,V>Serializer for non-diffable map valuesstatic classDiffableUtils.StringSetValueSerializer<K>Implementation of ValueSerializer that serializes immutable setsstatic interfaceDiffableUtils.ValueSerializer<K,V>Provides read and write operations to serialize map values.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,T extends Diffable<T>>
DiffableUtils.MapDiff<K,T,java.util.Map<K,T>>diff(java.util.Map<K,T> before, java.util.Map<K,T> after, DiffableUtils.KeySerializer<K> keySerializer)Calculates diff between two Maps of Diffable objects.static <K,T>
DiffableUtils.MapDiff<K,T,java.util.Map<K,T>>diff(java.util.Map<K,T> before, java.util.Map<K,T> after, DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K,T> valueSerializer)Calculates diff between two Maps of non-diffable objectsstatic <T extends Diffable<T>>
DiffableUtils.MapDiff<java.lang.Integer,T,ImmutableOpenIntMap<T>>diff(ImmutableOpenIntMap<T> before, ImmutableOpenIntMap<T> after, DiffableUtils.KeySerializer<java.lang.Integer> keySerializer)Calculates diff between two ImmutableOpenIntMaps of Diffable objectsstatic <T> DiffableUtils.MapDiff<java.lang.Integer,T,ImmutableOpenIntMap<T>>diff(ImmutableOpenIntMap<T> before, ImmutableOpenIntMap<T> after, DiffableUtils.KeySerializer<java.lang.Integer> keySerializer, DiffableUtils.ValueSerializer<java.lang.Integer,T> valueSerializer)Calculates diff between two ImmutableOpenIntMaps of non-diffable objectsstatic <K,T extends Diffable<T>>
DiffableUtils.MapDiff<K,T,ImmutableOpenMap<K,T>>diff(ImmutableOpenMap<K,T> before, ImmutableOpenMap<K,T> after, DiffableUtils.KeySerializer<K> keySerializer)Calculates diff between two ImmutableOpenMaps of Diffable objectsstatic <K,T>
DiffableUtils.MapDiff<K,T,ImmutableOpenMap<K,T>>diff(ImmutableOpenMap<K,T> before, ImmutableOpenMap<K,T> after, DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K,T> valueSerializer)Calculates diff between two ImmutableOpenMaps of non-diffable objectsstatic DiffableUtils.KeySerializer<java.lang.Integer>getIntKeySerializer()Returns a map key serializer for Integer keys.static DiffableUtils.KeySerializer<java.lang.String>getStringKeySerializer()Returns a map key serializer for String keysstatic DiffableUtils.KeySerializer<java.lang.Integer>getVIntKeySerializer()Returns a map key serializer for Integer keys.static <T> DiffableUtils.MapDiff<java.lang.Integer,T,ImmutableOpenIntMap<T>>readImmutableOpenIntMapDiff(StreamInput in, DiffableUtils.KeySerializer<java.lang.Integer> keySerializer, DiffableUtils.ValueSerializer<java.lang.Integer,T> valueSerializer)Loads an object that represents difference between two ImmutableOpenMapsstatic <T extends Diffable<T>>
DiffableUtils.MapDiff<java.lang.Integer,T,ImmutableOpenIntMap<T>>readImmutableOpenIntMapDiff(StreamInput in, DiffableUtils.KeySerializer<java.lang.Integer> keySerializer, Writeable.Reader<T> reader, Writeable.Reader<Diff<T>> diffReader)Loads an object that represents difference between two ImmutableOpenIntMaps of Diffable objects using Diffable proto objectstatic <K,T>
DiffableUtils.MapDiff<K,T,ImmutableOpenMap<K,T>>readImmutableOpenMapDiff(StreamInput in, DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K,T> valueSerializer)Loads an object that represents difference between two ImmutableOpenMapsstatic <K,T extends Diffable<T>>
DiffableUtils.MapDiff<K,T,ImmutableOpenMap<K,T>>readImmutableOpenMapDiff(StreamInput in, DiffableUtils.KeySerializer<K> keySerializer, Writeable.Reader<T> reader, Writeable.Reader<Diff<T>> diffReader)Loads an object that represents difference between two ImmutableOpenMaps of Diffable objects using Diffable proto objectstatic <K,T>
DiffableUtils.MapDiff<K,T,java.util.Map<K,T>>readJdkMapDiff(StreamInput in, DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K,T> valueSerializer)Loads an object that represents difference between two Maps of Diffable objectsstatic <K,T extends Diffable<T>>
DiffableUtils.MapDiff<K,T,java.util.Map<K,T>>readJdkMapDiff(StreamInput in, DiffableUtils.KeySerializer<K> keySerializer, Writeable.Reader<T> reader, Writeable.Reader<Diff<T>> diffReader)Loads an object that represents difference between two Maps of Diffable objects using Diffable proto object
-
-
-
Method Detail
-
getStringKeySerializer
public static DiffableUtils.KeySerializer<java.lang.String> getStringKeySerializer()
Returns a map key serializer for String keys
-
getIntKeySerializer
public static DiffableUtils.KeySerializer<java.lang.Integer> getIntKeySerializer()
Returns a map key serializer for Integer keys. Encodes as Int.
-
getVIntKeySerializer
public static DiffableUtils.KeySerializer<java.lang.Integer> getVIntKeySerializer()
Returns a map key serializer for Integer keys. Encodes as VInt.
-
diff
public static <K,T extends Diffable<T>> DiffableUtils.MapDiff<K,T,ImmutableOpenMap<K,T>> diff(ImmutableOpenMap<K,T> before, ImmutableOpenMap<K,T> after, DiffableUtils.KeySerializer<K> keySerializer)
Calculates diff between two ImmutableOpenMaps of Diffable objects
-
diff
public static <K,T> DiffableUtils.MapDiff<K,T,ImmutableOpenMap<K,T>> diff(ImmutableOpenMap<K,T> before, ImmutableOpenMap<K,T> after, DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K,T> valueSerializer)
Calculates diff between two ImmutableOpenMaps of non-diffable objects
-
diff
public static <T extends Diffable<T>> DiffableUtils.MapDiff<java.lang.Integer,T,ImmutableOpenIntMap<T>> diff(ImmutableOpenIntMap<T> before, ImmutableOpenIntMap<T> after, DiffableUtils.KeySerializer<java.lang.Integer> keySerializer)
Calculates diff between two ImmutableOpenIntMaps of Diffable objects
-
diff
public static <T> DiffableUtils.MapDiff<java.lang.Integer,T,ImmutableOpenIntMap<T>> diff(ImmutableOpenIntMap<T> before, ImmutableOpenIntMap<T> after, DiffableUtils.KeySerializer<java.lang.Integer> keySerializer, DiffableUtils.ValueSerializer<java.lang.Integer,T> valueSerializer)
Calculates diff between two ImmutableOpenIntMaps of non-diffable objects
-
diff
public static <K,T extends Diffable<T>> DiffableUtils.MapDiff<K,T,java.util.Map<K,T>> diff(java.util.Map<K,T> before, java.util.Map<K,T> after, DiffableUtils.KeySerializer<K> keySerializer)
Calculates diff between two Maps of Diffable objects.
-
diff
public static <K,T> DiffableUtils.MapDiff<K,T,java.util.Map<K,T>> diff(java.util.Map<K,T> before, java.util.Map<K,T> after, DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K,T> valueSerializer)
Calculates diff between two Maps of non-diffable objects
-
readImmutableOpenMapDiff
public static <K,T> DiffableUtils.MapDiff<K,T,ImmutableOpenMap<K,T>> readImmutableOpenMapDiff(StreamInput in, DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K,T> valueSerializer) throws java.io.IOException
Loads an object that represents difference between two ImmutableOpenMaps- Throws:
java.io.IOException
-
readImmutableOpenIntMapDiff
public static <T> DiffableUtils.MapDiff<java.lang.Integer,T,ImmutableOpenIntMap<T>> readImmutableOpenIntMapDiff(StreamInput in, DiffableUtils.KeySerializer<java.lang.Integer> keySerializer, DiffableUtils.ValueSerializer<java.lang.Integer,T> valueSerializer) throws java.io.IOException
Loads an object that represents difference between two ImmutableOpenMaps- Throws:
java.io.IOException
-
readJdkMapDiff
public static <K,T> DiffableUtils.MapDiff<K,T,java.util.Map<K,T>> readJdkMapDiff(StreamInput in, DiffableUtils.KeySerializer<K> keySerializer, DiffableUtils.ValueSerializer<K,T> valueSerializer) throws java.io.IOException
Loads an object that represents difference between two Maps of Diffable objects- Throws:
java.io.IOException
-
readImmutableOpenMapDiff
public static <K,T extends Diffable<T>> DiffableUtils.MapDiff<K,T,ImmutableOpenMap<K,T>> readImmutableOpenMapDiff(StreamInput in, DiffableUtils.KeySerializer<K> keySerializer, Writeable.Reader<T> reader, Writeable.Reader<Diff<T>> diffReader) throws java.io.IOException
Loads an object that represents difference between two ImmutableOpenMaps of Diffable objects using Diffable proto object- Throws:
java.io.IOException
-
readImmutableOpenIntMapDiff
public static <T extends Diffable<T>> DiffableUtils.MapDiff<java.lang.Integer,T,ImmutableOpenIntMap<T>> readImmutableOpenIntMapDiff(StreamInput in, DiffableUtils.KeySerializer<java.lang.Integer> keySerializer, Writeable.Reader<T> reader, Writeable.Reader<Diff<T>> diffReader) throws java.io.IOException
Loads an object that represents difference between two ImmutableOpenIntMaps of Diffable objects using Diffable proto object- Throws:
java.io.IOException
-
readJdkMapDiff
public static <K,T extends Diffable<T>> DiffableUtils.MapDiff<K,T,java.util.Map<K,T>> readJdkMapDiff(StreamInput in, DiffableUtils.KeySerializer<K> keySerializer, Writeable.Reader<T> reader, Writeable.Reader<Diff<T>> diffReader) throws java.io.IOException
Loads an object that represents difference between two Maps of Diffable objects using Diffable proto object- Throws:
java.io.IOException
-
-