Class ClusterMetricsMessageSerializer
Protobuf serializer for Akka.Cluster.Metrics.Serialization.IClusterMetricMessage types.
Inherited Members
Namespace: Akka.Cluster.Metrics.Serialization
Assembly: Akka.Cluster.Metrics.dll
Syntax
public class ClusterMetricsMessageSerializer : SerializerWithStringManifest
Constructors
| Improve this Doc View SourceClusterMetricsMessageSerializer(ExtendedActorSystem)
Initializes a new instance of the SerializerWithStringManifest class.
Declaration
public ClusterMetricsMessageSerializer(ExtendedActorSystem system)
Parameters
Type | Name | Description |
---|---|---|
ExtendedActorSystem | system | The actor system to associate with this serializer. |
Methods
| Improve this Doc View SourceFromBinary(Byte[], String)
Deserializes a byte array into an object using an optional manifest
(type hint).
It's recommended to throw SerializationException in FromBinary(Byte[], String) 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. SerializationException 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.
Declaration
public override object FromBinary(byte[] bytes, string manifest)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | bytes | The array containing the serialized object |
String | manifest | The type hint used to deserialize the object contained in the array. |
Returns
Type | Description |
---|---|
Object | The object contained in the array |
Overrides
| Improve this Doc View SourceManifest(Object)
Returns the manifest (type hint) that will be provided in the FromBinary(Byte[], Type) method.
note
This method returns Empty if a manifest is not needed.
Declaration
public override string Manifest(object o)
Parameters
Type | Name | Description |
---|---|---|
Object | o | The object for which the manifest is needed. |
Returns
Type | Description |
---|---|
String | The manifest needed for the deserialization of the specified |
Overrides
| Improve this Doc View SourceToBinary(Object)
Serializes the given object into a byte array
Declaration
public override byte[] ToBinary(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object to serialize |
Returns
Type | Description |
---|---|
Byte[] | A byte array containing the serialized object |