Package akka.cluster.ddata.protobuf
Class ReplicatedDataSerializer
- java.lang.Object
-
- akka.serialization.SerializerWithStringManifest
-
- akka.cluster.ddata.protobuf.ReplicatedDataSerializer
-
- All Implemented Interfaces:
SerializationSupport
,BaseSerializer
,Serializer
public class ReplicatedDataSerializer extends SerializerWithStringManifest implements SerializationSupport, BaseSerializer
Protobuf serializer of ReplicatedData.
-
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description ReplicatedDataSerializer(ExtendedActorSystem system)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
akka$serialization$BaseSerializer$_setter_$identifier_$eq(int x$1)
Globally unique serialization identifier configured in thereference.conf
.Flag
flagFromBinary(byte[] bytes)
Flag
flagFromProto(ReplicatedDataMessages.Flag flag)
ReplicatedDataMessages.Flag
flagToProto(Flag flag)
java.lang.Object
fromBinary(byte[] bytes, java.lang.String manifest)
Produces an object from an array of bytes, with an optional type-hint.GCounter
gcounterFromBinary(byte[] bytes)
GCounter
gcounterFromProto(ReplicatedDataMessages.GCounter gcounter)
ReplicatedDataMessages.GCounter
gcounterToProto(GCounter gcounter)
GSet<?>
gsetFromBinary(byte[] bytes)
GSet<java.lang.Object>
gsetFromProto(ReplicatedDataMessages.GSet gset)
ReplicatedDataMessages.GSet
gsetToProto(GSet<?> gset)
int
identifier()
Completely unique value to identify this implementation of Serializer, used to optimize network traffic.java.lang.String
keyIdFromBinary(byte[] bytes)
byte[]
keyIdToBinary(java.lang.String id)
LWWMap<java.lang.Object,java.lang.Object>
lwwmapFromBinary(byte[] bytes)
LWWMap<java.lang.Object,java.lang.Object>
lwwmapFromProto(ReplicatedDataMessages.LWWMap lwwmap)
ReplicatedDataMessages.LWWMap
lwwmapToProto(LWWMap<?,?> lwwmap)
LWWRegister<java.lang.Object>
lwwRegisterFromBinary(byte[] bytes)
LWWRegister<java.lang.Object>
lwwRegisterFromProto(ReplicatedDataMessages.LWWRegister lwwRegister)
ReplicatedDataMessages.LWWRegister
lwwRegisterToProto(LWWRegister<?> lwwRegister)
java.lang.String
manifest(java.lang.Object obj)
Return the manifest (type hint) that will be provided in the fromBinary method.<PEntry extends akka.protobufv3.internal.GeneratedMessageV3,A extends akka.protobufv3.internal.GeneratedMessageV3,B extends ReplicatedData>
scala.collection.immutable.Map<java.lang.Object,B>mapTypeFromProto(java.util.List<PEntry> input, scala.Function1<A,B> valueCreator, ReplicatedDataSerializer.ProtoMapEntryReader<PEntry,A> eh)
ORMultiMap<java.lang.Object,java.lang.Object>
multimapFromBinary(byte[] bytes)
ORMultiMap<java.lang.Object,java.lang.Object>
multimapFromProto(ReplicatedDataMessages.ORMultiMap multimap)
ReplicatedDataMessages.ORMultiMap
multimapToProto(ORMultiMap<?,?> multimap)
ORMap<java.lang.Object,ReplicatedData>
ormapFromBinary(byte[] bytes)
ORMap<java.lang.Object,ReplicatedData>
ormapFromProto(ReplicatedDataMessages.ORMap ormap)
ReplicatedDataMessages.ORMap
ormapToProto(ORMap<?,?> ormap)
ORSet<java.lang.Object>
orsetFromBinary(byte[] bytes)
ORSet<java.lang.Object>
orsetFromProto(ReplicatedDataMessages.ORSet orset)
ReplicatedDataMessages.ORSet
orsetToProto(ORSet<?> orset)
PNCounter
pncounterFromBinary(byte[] bytes)
PNCounter
pncounterFromProto(ReplicatedDataMessages.PNCounter pncounter)
PNCounterMap<?>
pncountermapFromBinary(byte[] bytes)
PNCounterMap<?>
pncountermapFromProto(ReplicatedDataMessages.PNCounterMap pncountermap)
ReplicatedDataMessages.PNCounterMap
pncountermapToProto(PNCounterMap<?> pncountermap)
ReplicatedDataMessages.PNCounter
pncounterToProto(PNCounter pncounter)
<PEntry extends akka.protobufv3.internal.GeneratedMessageV3,A extends akka.protobufv3.internal.GeneratedMessageV3>
java.lang.ObjectsingleKeyEntryFromProto(scala.Option<PEntry> entryOption, ReplicatedDataSerializer.ProtoMapEntryReader<PEntry,A> eh)
<PEntry extends akka.protobufv3.internal.GeneratedMessageV3,A extends akka.protobufv3.internal.GeneratedMessageV3,B extends ReplicatedData>
scala.collection.immutable.Map<java.lang.Object,B>singleMapEntryFromProto(java.util.List<PEntry> input, scala.Function1<A,B> valueCreator, ReplicatedDataSerializer.ProtoMapEntryReader<PEntry,A> eh)
ExtendedActorSystem
system()
Actor system which is required by most serializer implementations.byte[]
toBinary(java.lang.Object obj)
Serializes the given object into an Array of Byte.-
Methods inherited from class akka.serialization.SerializerWithStringManifest
fromBinary, includeManifest
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.serialization.BaseSerializer
identifierFromConfig, SerializationIdentifiers
-
Methods inherited from interface akka.cluster.ddata.protobuf.SerializationSupport
addressFromProto, addressProtocol, addressToProto, BufferSize, compress, decompress, otherMessageFromBinary, otherMessageFromProto, otherMessageToProto, protocol_$eq, resolveActorRef, ser_$eq, serialization, transportInfo_$eq, transportInformation, uniqueAddressFromProto, uniqueAddressToProto, versionVectorFromBinary, versionVectorFromProto, versionVectorToProto
-
Methods inherited from interface akka.serialization.Serializer
fromBinary, fromBinary, fromBinary, includeManifest
-
-
-
-
Constructor Detail
-
ReplicatedDataSerializer
public ReplicatedDataSerializer(ExtendedActorSystem system)
-
-
Method Detail
-
identifier
public int identifier()
Description copied from class:SerializerWithStringManifest
Completely unique value to identify this implementation of Serializer, used to optimize network traffic. Values from 0 to 40 are reserved for Akka internal usage.- Specified by:
identifier
in interfaceBaseSerializer
- Specified by:
identifier
in interfaceSerializer
- Specified by:
identifier
in classSerializerWithStringManifest
-
akka$serialization$BaseSerializer$_setter_$identifier_$eq
protected void akka$serialization$BaseSerializer$_setter_$identifier_$eq(int x$1)
Description copied from interface:BaseSerializer
Globally unique serialization identifier configured in thereference.conf
.See
Serializer.identifier
.- Specified by:
akka$serialization$BaseSerializer$_setter_$identifier_$eq
in interfaceBaseSerializer
-
system
public ExtendedActorSystem system()
Description copied from interface:BaseSerializer
Actor system which is required by most serializer implementations.- Specified by:
system
in interfaceBaseSerializer
- Specified by:
system
in interfaceSerializationSupport
-
manifest
public java.lang.String manifest(java.lang.Object obj)
Description copied from class:SerializerWithStringManifest
Return the manifest (type hint) that will be provided in the fromBinary method. Use""
if manifest is not needed.- Specified by:
manifest
in classSerializerWithStringManifest
-
toBinary
public byte[] toBinary(java.lang.Object obj)
Description copied from class:SerializerWithStringManifest
Serializes the given object into an Array of Byte.Note that the array must not be mutated by the serializer after it has been returned.
- Specified by:
toBinary
in interfaceSerializer
- Specified by:
toBinary
in classSerializerWithStringManifest
-
fromBinary
public java.lang.Object fromBinary(byte[] bytes, java.lang.String manifest)
Description copied from class:SerializerWithStringManifest
Produces an object from an array of bytes, with an optional type-hint.It's recommended to throw
java.io.NotSerializableException
infromBinary
if the manifest is unknown. This makes it possible to introduce new message types and send them to nodes that don't know about them. This is typically needed when performing rolling upgrades, i.e. running a cluster with mixed versions for while.NotSerializableException
is treated as a transient problem in the TCP based remoting layer. The problem will be logged and message is dropped. Other exceptions will tear down the TCP connection because it can be an indication of corrupt bytes from the underlying transport.- Specified by:
fromBinary
in classSerializerWithStringManifest
-
gsetToProto
public ReplicatedDataMessages.GSet gsetToProto(GSet<?> gset)
-
gsetFromBinary
public GSet<?> gsetFromBinary(byte[] bytes)
-
gsetFromProto
public GSet<java.lang.Object> gsetFromProto(ReplicatedDataMessages.GSet gset)
-
orsetToProto
public ReplicatedDataMessages.ORSet orsetToProto(ORSet<?> orset)
-
orsetFromBinary
public ORSet<java.lang.Object> orsetFromBinary(byte[] bytes)
-
orsetFromProto
public ORSet<java.lang.Object> orsetFromProto(ReplicatedDataMessages.ORSet orset)
-
flagToProto
public ReplicatedDataMessages.Flag flagToProto(Flag flag)
-
flagFromBinary
public Flag flagFromBinary(byte[] bytes)
-
flagFromProto
public Flag flagFromProto(ReplicatedDataMessages.Flag flag)
-
lwwRegisterToProto
public ReplicatedDataMessages.LWWRegister lwwRegisterToProto(LWWRegister<?> lwwRegister)
-
lwwRegisterFromBinary
public LWWRegister<java.lang.Object> lwwRegisterFromBinary(byte[] bytes)
-
lwwRegisterFromProto
public LWWRegister<java.lang.Object> lwwRegisterFromProto(ReplicatedDataMessages.LWWRegister lwwRegister)
-
gcounterToProto
public ReplicatedDataMessages.GCounter gcounterToProto(GCounter gcounter)
-
gcounterFromBinary
public GCounter gcounterFromBinary(byte[] bytes)
-
gcounterFromProto
public GCounter gcounterFromProto(ReplicatedDataMessages.GCounter gcounter)
-
pncounterToProto
public ReplicatedDataMessages.PNCounter pncounterToProto(PNCounter pncounter)
-
pncounterFromBinary
public PNCounter pncounterFromBinary(byte[] bytes)
-
pncounterFromProto
public PNCounter pncounterFromProto(ReplicatedDataMessages.PNCounter pncounter)
-
ormapToProto
public ReplicatedDataMessages.ORMap ormapToProto(ORMap<?,?> ormap)
-
ormapFromBinary
public ORMap<java.lang.Object,ReplicatedData> ormapFromBinary(byte[] bytes)
-
mapTypeFromProto
public <PEntry extends akka.protobufv3.internal.GeneratedMessageV3,A extends akka.protobufv3.internal.GeneratedMessageV3,B extends ReplicatedData> scala.collection.immutable.Map<java.lang.Object,B> mapTypeFromProto(java.util.List<PEntry> input, scala.Function1<A,B> valueCreator, ReplicatedDataSerializer.ProtoMapEntryReader<PEntry,A> eh)
-
ormapFromProto
public ORMap<java.lang.Object,ReplicatedData> ormapFromProto(ReplicatedDataMessages.ORMap ormap)
-
singleMapEntryFromProto
public <PEntry extends akka.protobufv3.internal.GeneratedMessageV3,A extends akka.protobufv3.internal.GeneratedMessageV3,B extends ReplicatedData> scala.collection.immutable.Map<java.lang.Object,B> singleMapEntryFromProto(java.util.List<PEntry> input, scala.Function1<A,B> valueCreator, ReplicatedDataSerializer.ProtoMapEntryReader<PEntry,A> eh)
-
singleKeyEntryFromProto
public <PEntry extends akka.protobufv3.internal.GeneratedMessageV3,A extends akka.protobufv3.internal.GeneratedMessageV3> java.lang.Object singleKeyEntryFromProto(scala.Option<PEntry> entryOption, ReplicatedDataSerializer.ProtoMapEntryReader<PEntry,A> eh)
-
lwwmapToProto
public ReplicatedDataMessages.LWWMap lwwmapToProto(LWWMap<?,?> lwwmap)
-
lwwmapFromBinary
public LWWMap<java.lang.Object,java.lang.Object> lwwmapFromBinary(byte[] bytes)
-
lwwmapFromProto
public LWWMap<java.lang.Object,java.lang.Object> lwwmapFromProto(ReplicatedDataMessages.LWWMap lwwmap)
-
pncountermapToProto
public ReplicatedDataMessages.PNCounterMap pncountermapToProto(PNCounterMap<?> pncountermap)
-
pncountermapFromBinary
public PNCounterMap<?> pncountermapFromBinary(byte[] bytes)
-
pncountermapFromProto
public PNCounterMap<?> pncountermapFromProto(ReplicatedDataMessages.PNCounterMap pncountermap)
-
multimapToProto
public ReplicatedDataMessages.ORMultiMap multimapToProto(ORMultiMap<?,?> multimap)
-
multimapFromBinary
public ORMultiMap<java.lang.Object,java.lang.Object> multimapFromBinary(byte[] bytes)
-
multimapFromProto
public ORMultiMap<java.lang.Object,java.lang.Object> multimapFromProto(ReplicatedDataMessages.ORMultiMap multimap)
-
keyIdToBinary
public byte[] keyIdToBinary(java.lang.String id)
-
keyIdFromBinary
public java.lang.String keyIdFromBinary(byte[] bytes)
-
-