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

    • 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 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
    • 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
      Returns:
      RaftLogEntry