Interface MetadataSerde<T>

Type Parameters:
T -
All Known Implementing Classes:
BookieServiceInfoSerde, JSONMetadataSerdeSimpleType, JSONMetadataSerdeTypeRef

public interface MetadataSerde<T>
Interface that define a serializer/deserializer implementation.
  • Method Summary

    Modifier and Type
    Method
    Description
    deserialize(String path, byte[] content, Stat stat)
    Serialize the object from a byte array.
    byte[]
    serialize(String path, T value)
    Serialize the object into a byte array.
  • Method Details

    • serialize

      byte[] serialize(String path, T value) throws IOException
      Serialize the object into a byte array.
      Parameters:
      path - the path of the object on the metadata store
      value - the object instance
      Returns:
      a byte array of the serialized version
      Throws:
      IOException - if the serialization fails
    • deserialize

      T deserialize(String path, byte[] content, Stat stat) throws IOException
      Serialize the object from a byte array.
      Parameters:
      path - the path of the object on the metadata store
      content - the content as stored on metadata store
      stat - the Stat metadata for the object
      Returns:
      the deserialized object
      Throws:
      IOException - if the deserialization fails