Package com.linkedin.venice.helix
Class SchemaEntrySerializer
- java.lang.Object
-
- com.linkedin.venice.helix.SchemaEntrySerializer
-
- All Implemented Interfaces:
VeniceSerializer<SchemaEntry>
public class SchemaEntrySerializer extends java.lang.Object implements VeniceSerializer<SchemaEntry>
This class to use to serialize/deserialize Zookeeper node
-
-
Constructor Summary
Constructors Constructor Description SchemaEntrySerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaEntry
deserialize(byte[] bytes, java.lang.String path)
This function will extract schema from file path, and schema content from ZNode data.byte[]
serialize(SchemaEntry object, java.lang.String path)
This function only serialize schema content, and the caller will be charge of storing schema id as part of file path.
-
-
-
Method Detail
-
serialize
public byte[] serialize(SchemaEntry object, java.lang.String path) throws java.io.IOException
This function only serialize schema content, and the caller will be charge of storing schema id as part of file path.- Specified by:
serialize
in interfaceVeniceSerializer<SchemaEntry>
- Parameters:
object
-path
-- Returns:
- Throws:
java.io.IOException
-
deserialize
public SchemaEntry deserialize(byte[] bytes, java.lang.String path) throws java.io.IOException
This function will extract schema from file path, and schema content from ZNode data.- Specified by:
deserialize
in interfaceVeniceSerializer<SchemaEntry>
- Parameters:
bytes
-path
-- Returns:
- Throws:
java.io.IOException
-
-