Class TraceEnvelopeSerializer
Serializer implementation for passing IWithTrace instances back and forth across the wire.
Inherited Members
Namespace: Phobos.Tracing.Serialization
Assembly: Phobos.Tracing.dll
Syntax
public sealed class TraceEnvelopeSerializer : SerializerWithStringManifest
Constructors
TraceEnvelopeSerializer(ExtendedActorSystem)
Declaration
public TraceEnvelopeSerializer(ExtendedActorSystem system)
Parameters
Type | Name | Description |
---|---|---|
ExtendedActorSystem | system |
Fields
WithTraceManifest
Declaration
public const string WithTraceManifest = "WTRACE"
Field Value
Type | Description |
---|---|
string |
Properties
Tracer
Declaration
public Tracer Tracer { get; }
Property Value
Type | Description |
---|---|
Tracer |
Methods
FromBinary(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
Manifest(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
ToBinary(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 |