Interface RaftEntrySerializer

All Known Implementing Classes:
RaftEntrySBESerializer

public interface RaftEntrySerializer
  • Method Details

    • getApplicationEntrySerializedLength

      int getApplicationEntrySerializedLength(ApplicationEntry entry)
      Determines the length in bytes of a serialized application entry.
      Parameters:
      entry - to determine the length in bytes for
      Returns:
      the length in bytes when the entry gets serialized
    • getInitialEntrySerializedLength

      int getInitialEntrySerializedLength()
      Determines the length in bytes of a serialized initial entry.
      Returns:
      the length in bytes of a serialized initial entry
    • getConfigurationEntrySerializedLength

      int getConfigurationEntrySerializedLength(ConfigurationEntry entry)
      Determines the length in bytes of a serialized configuration entry.
      Parameters:
      entry - to determine the length in bytes for
      Returns:
      the length in bytes when the entry gets serialized
    • writeApplicationEntry

      int writeApplicationEntry(long term, ApplicationEntry entry, org.agrona.MutableDirectBuffer buffer, int offset)
      Writes the term and entry into given buffer at the given offset
      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

      int writeInitialEntry(long term, InitialEntry entry, org.agrona.MutableDirectBuffer buffer, int offset)
      Writes the term and entry into given buffer at the given offset
      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

      int writeConfigurationEntry(long term, ConfigurationEntry entry, org.agrona.MutableDirectBuffer buffer, int offset)
      Writes the term and entry into given buffer at the given offset
      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

      RaftLogEntry readRaftLogEntry(org.agrona.DirectBuffer buffer)
      Read the raft log entry from the buffer
      Parameters:
      buffer - to read the raft log entry from
      Returns:
      RaftLogEntry