Class SerDe


  • @NotThreadSafe
    public class SerDe
    extends Object
    Thrift based serialization-deserialization. Note: We did not make this a serialization protocol (thrift, kryo, protobuf...) agnostic interface as the underlying requests/response is itself specific to protocol (thrift vs protobuf). It does not make sense to encapsulate the serialization logic from it. In future if you want to move away from thrift, you would have to regenerate (or redefine) request/response classes anyways and implement the SerDe for it. Please note the implementation is not thread-safe as underlying thrift serialization is not threadsafe.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.slf4j.Logger LOGGER  
    • Constructor Summary

      Constructors 
      Constructor Description
      SerDe​(org.apache.thrift.protocol.TProtocolFactory factory)  
    • Field Detail

      • LOGGER

        protected static final org.slf4j.Logger LOGGER
    • Constructor Detail

      • SerDe

        public SerDe​(org.apache.thrift.protocol.TProtocolFactory factory)
    • Method Detail

      • serialize

        public byte[] serialize​(org.apache.thrift.TBase obj)
      • deserialize

        public boolean deserialize​(org.apache.thrift.TBase obj,
                                   byte[] payload)