|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoldemort.serialization.avro.AvroSpecificSerializer<T>
public class AvroSpecificSerializer<T extends org.apache.avro.specific.SpecificRecord>
Avro serializer that relies on generated Java classes for schemas and protocols.
This API is recommended for most RPC uses and for data applications that always use the same datatypes, i.e., whose schemas are known at compile time. For data applications that accept dynamic datatypes the generic API is recommended.
Constructor Summary | |
---|---|
AvroSpecificSerializer(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 AvroSpecificSerializer(java.lang.String schemaInfo)
schemaInfo
- information on the schema for the serializer.Method Detail |
---|
public byte[] toBytes(T object)
Serializer
toBytes
in interface Serializer<T extends org.apache.avro.specific.SpecificRecord>
object
- The object
public T toObject(byte[] bytes)
Serializer
toObject
in interface Serializer<T extends org.apache.avro.specific.SpecificRecord>
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 |