Given a namespace of Avro messages which represent a protocol, the ProtocolSerailizer class reflects all of the message classes and builds Avro seriailziers and deserializers.
More...
|
| ProtocolSerializer (Assembly assembly, string messageNamespace) |
| Register all of the protocol messages using reflection. More...
|
|
byte [] | Write (object message, long sequence) |
| Serialize the input message and return a byte array. More...
|
|
void | Read< T > (byte[] data, IObserver< IMessageInstance< T >> observer) |
| Read a message from the input byte array. More...
|
|
Given a namespace of Avro messages which represent a protocol, the ProtocolSerailizer class reflects all of the message classes and builds Avro seriailziers and deserializers.
Avro messages are then serialized/deserilaized to and from byte[] arrays using the Read/Write methods. A transport such as a RemoteObserver using a ByteCodec can then be used to send and receive the serialized messages.
◆ ProtocolSerializer()
Org.Apache.REEF.Wake.Avro.ProtocolSerializer.ProtocolSerializer |
( |
Assembly |
assembly, |
|
|
string |
messageNamespace |
|
) |
| |
|
inline |
Register all of the protocol messages using reflection.
- Parameters
-
assembly | The Assembly object which contains the namespace of the message classes. |
messageNamespace | A string which contains the namespace the protocol messages. |
◆ Read< T >()
void Org.Apache.REEF.Wake.Avro.ProtocolSerializer.Read< T > |
( |
byte [] |
data, |
|
|
IObserver< IMessageInstance< T >> |
observer |
|
) |
| |
|
inline |
Read a message from the input byte array.
- Parameters
-
data | Byte array containing a header message and message to be deserialized. |
observer | An object which implements the IObserver<> interface for the message being deserialized. |
◆ Write()
byte [] Org.Apache.REEF.Wake.Avro.ProtocolSerializer.Write |
( |
object |
message, |
|
|
long |
sequence |
|
) |
| |
|
inline |
Serialize the input message and return a byte array.
- Parameters
-
message | An object reference to the messeage to be serialized |
sequence | A long which cotains the higher level protocols sequence number for the message. |
- Returns
- A byte array containing the serialized header and message.
The documentation for this class was generated from the following file: