|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoldemort.serialization.avro.AvroReflectiveSerializer<T>
public class AvroReflectiveSerializer<T>
Avro serializer that uses Java reflection to generate schemas and protocols for existing classes.
This API is not recommended except as a stepping stone for systems that currently uses Java interfaces to define RPC protocols. For new RPC systems, the Avro specific API is preferred. For systems that process dynamic data, the Avro generic API is probably best.
Reflection is supported from either the class, the schema or both. For now we only support the class case.
Constructor Summary | |
---|---|
AvroReflectiveSerializer(java.lang.String schemaInfo)
Constructor accepting a Java class name under the convention java=classname. |
Method Summary | |
---|---|
byte[] |
toBytes(T object)
Construct an array of bytes from the given object |
T |
toObject(byte[] bytes)
Create an object from an array of bytes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AvroReflectiveSerializer(java.lang.String schemaInfo)
schemaInfo
- information on the schema for the serializerMethod Detail |
---|
public byte[] toBytes(T object)
Serializer
toBytes
in interface Serializer<T>
object
- The object
public T toObject(byte[] bytes)
Serializer
toObject
in interface Serializer<T>
bytes
- An array of bytes with the objects data
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |