Class RaftEntrySBESerializer

java.lang.Object
io.atomix.raft.storage.serializer.RaftEntrySBESerializer
All Implemented Interfaces:
RaftEntrySerializer

public class RaftEntrySBESerializer extends Object implements RaftEntrySerializer
  • Constructor Details

    • RaftEntrySBESerializer

      public RaftEntrySBESerializer()
  • Method Details

    • getApplicationEntrySerializedLength

      public int getApplicationEntrySerializedLength(ApplicationEntry entry)
      Description copied from interface: RaftEntrySerializer
      Determines the length in bytes of a serialized application entry.
      Specified by:
      getApplicationEntrySerializedLength in interface RaftEntrySerializer
      Parameters:
      entry - to determine the length in bytes for
      Returns:
      the length in bytes when the entry gets serialized
    • getInitialEntrySerializedLength

      public int getInitialEntrySerializedLength()
      Description copied from interface: RaftEntrySerializer
      Determines the length in bytes of a serialized initial entry.
      Specified by:
      getInitialEntrySerializedLength in interface RaftEntrySerializer
      Returns:
      the length in bytes of a serialized initial entry
    • getConfigurationEntrySerializedLength

      public int getConfigurationEntrySerializedLength(ConfigurationEntry entry)
      Description copied from interface: RaftEntrySerializer
      Determines the length in bytes of a serialized configuration entry.
      Specified by:
      getConfigurationEntrySerializedLength in interface RaftEntrySerializer
      Parameters:
      entry - to determine the length in bytes for
      Returns:
      the length in bytes when the entry gets serialized
    • writeApplicationEntry

      public int writeApplicationEntry(long term, ApplicationEntry entry, org.agrona.MutableDirectBuffer buffer, int offset)
      Description copied from interface: RaftEntrySerializer
      Writes the term and entry into given buffer at the given offset
      Specified by:
      writeApplicationEntry in interface RaftEntrySerializer
      Parameters:
      term - the term of the entry
      entry - the ApplicationEntry to write
      buffer - the buffer to write to
      offset - the offset in the buffer at which the term and entry will be written
      Returns:
      the number of bytes written
    • writeInitialEntry

      public int writeInitialEntry(long term, InitialEntry entry, org.agrona.MutableDirectBuffer buffer, int offset)
      Description copied from interface: RaftEntrySerializer
      Writes the term and entry into given buffer at the given offset
      Specified by:
      writeInitialEntry in interface RaftEntrySerializer
      Parameters:
      term - the term of the entry
      entry - the InitialEntry to write
      buffer - the buffer to write to
      offset - the offset in the buffer at which the term and entry will be written
      Returns:
      the number of bytes written
    • writeConfigurationEntry

      public int writeConfigurationEntry(long term, ConfigurationEntry entry, org.agrona.MutableDirectBuffer buffer, int offset)
      Description copied from interface: RaftEntrySerializer
      Writes the term and entry into given buffer at the given offset
      Specified by:
      writeConfigurationEntry in interface RaftEntrySerializer
      Parameters:
      term - the term of the entry
      entry - the ConfigurationEntry to write
      buffer - the buffer to write to
      offset - the offset in the buffer at which the term and entry will be written
      Returns:
      the number of bytes written
    • readRaftLogEntry

      public RaftLogEntry readRaftLogEntry(org.agrona.DirectBuffer buffer)
      Description copied from interface: RaftEntrySerializer
      Read the raft log entry from the buffer
      Specified by:
      readRaftLogEntry in interface RaftEntrySerializer
      Parameters:
      buffer - to read the raft log entry from
      Returns:
      RaftLogEntry