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 java.lang.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
Constructors Constructor Description HelixAdapterSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
deserialize(byte[] bytes, java.lang.String path)
void
registerSerializer(java.lang.String path, VeniceSerializer serializer)
byte[]
serialize(java.lang.Object data, java.lang.String path)
void
unregisterSerializer(java.lang.String path)
-
-
-
Method Detail
-
registerSerializer
public void registerSerializer(java.lang.String path, VeniceSerializer serializer)
-
unregisterSerializer
public void unregisterSerializer(java.lang.String path)
-
serialize
public byte[] serialize(java.lang.Object data, java.lang.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 java.lang.Object deserialize(byte[] bytes, java.lang.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
-
-