Class 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 Detail

      • HelixAdapterSerializer

        public HelixAdapterSerializer()
    • 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 interface org.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 interface org.apache.helix.zookeeper.zkclient.serialize.PathBasedZkSerializer
        Throws:
        org.apache.helix.zookeeper.zkclient.exception.ZkMarshallingError