Package org.apache.pulsar.metadata.api
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tdeserialize(java.lang.String path, byte[] content, Stat stat)Serialize the object from a byte array.byte[]serialize(java.lang.String path, T value)Serialize the object into a byte array.
-
-
-
Method Detail
-
serialize
byte[] serialize(java.lang.String path, T value) throws java.io.IOExceptionSerialize the object into a byte array.- Parameters:
path- the path of the object on the metadata storevalue- the object instance- Returns:
- a byte array of the serialized version
- Throws:
java.io.IOException- if the serialization fails
-
deserialize
T deserialize(java.lang.String path, byte[] content, Stat stat) throws java.io.IOException
Serialize the object from a byte array.- Parameters:
path- the path of the object on the metadata storecontent- the content as stored on metadata storestat- theStatmetadata for the object- Returns:
- the deserialized object
- Throws:
java.io.IOException- if the deserialization fails
-
-