Interface OffsetExternalizer


  • public interface OffsetExternalizer
    Interface provides methods for serializing commit log offset Offset to external formats.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default Offset fromBytes​(byte[] bytes)
      Deserializes offset from bytes, default implementation uses native java serialization.
      Offset fromJson​(java.lang.String json)
      Deserializes offset from JSON string.
      default byte[] toBytes​(Offset offset)
      Serializes offset to bytes, default implementation uses native java serialization.
      java.lang.String toJson​(Offset offset)
      Serializes offset to JSON string.
    • Method Detail

      • toBytes

        default byte[] toBytes​(Offset offset)
        Serializes offset to bytes, default implementation uses native java serialization.
        Parameters:
        offset - to serialize.
        Returns:
        serialized offset in bytes
      • fromBytes

        default Offset fromBytes​(byte[] bytes)
        Deserializes offset from bytes, default implementation uses native java serialization.
        Parameters:
        bytes - to be deserialized to offset.
        Returns:
        deserialized offset
      • toJson

        java.lang.String toJson​(Offset offset)
        Serializes offset to JSON string.
        Parameters:
        offset - to serialize.
        Returns:
        serialized offset in JSON string.
      • fromJson

        Offset fromJson​(java.lang.String json)
        Deserializes offset from JSON string.
        Parameters:
        json - to be deserialized to offset.
        Returns:
        deserialized offset.