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 Details

    • HelixAdapterSerializer

      public HelixAdapterSerializer()
  • Method Details

    • registerSerializer

      public void registerSerializer(String path, VeniceSerializer serializer)
    • unregisterSerializer

      public void unregisterSerializer(String path)
    • serialize

      public byte[] serialize(Object data, String path) throws org.apache.helix.zookeeper.zkclient.exception.ZkMarshallingError
      Specified by:
      serialize in interface org.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 interface org.apache.helix.zookeeper.zkclient.serialize.PathBasedZkSerializer
      Throws:
      org.apache.helix.zookeeper.zkclient.exception.ZkMarshallingError