Package com.linkedin.venice.helix
Class HelixAdapterSerializer
java.lang.Object
com.linkedin.venice.helix.HelixAdapterSerializer
- All Implemented Interfaces:
org.apache.helix.manager.zk.PathBasedZkSerializer
,org.apache.helix.zookeeper.zkclient.serialize.PathBasedZkSerializer
public class HelixAdapterSerializer
extends Object
implements org.apache.helix.manager.zk.PathBasedZkSerializer
Serializer to adapt venice serializer to PathBasedZkSerializer. Find the venice serializer by given zk path and use
it to do the actual serialize and deserialize.
This class let venice can re-use on ZkClient to read/write different types of Venice objects.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(byte[] bytes, String path) void
registerSerializer
(String path, VeniceSerializer serializer) byte[]
void
unregisterSerializer
(String path)
-
Constructor Details
-
HelixAdapterSerializer
public HelixAdapterSerializer()
-
-
Method Details
-
registerSerializer
-
unregisterSerializer
-
serialize
public byte[] serialize(Object data, String path) throws org.apache.helix.zookeeper.zkclient.exception.ZkMarshallingError - Specified by:
serialize
in interfaceorg.apache.helix.zookeeper.zkclient.serialize.PathBasedZkSerializer
- Throws:
org.apache.helix.zookeeper.zkclient.exception.ZkMarshallingError
-
deserialize
public Object deserialize(byte[] bytes, String path) throws org.apache.helix.zookeeper.zkclient.exception.ZkMarshallingError - Specified by:
deserialize
in interfaceorg.apache.helix.zookeeper.zkclient.serialize.PathBasedZkSerializer
- Throws:
org.apache.helix.zookeeper.zkclient.exception.ZkMarshallingError
-