Interface RaftEntrySerializer
- All Known Implementing Classes:
RaftEntrySBESerializer
public interface RaftEntrySerializer
-
Method Summary
Modifier and TypeMethodDescriptionreadRaftLogEntry(org.agrona.DirectBuffer buffer) Read the raft log entry from the bufferintwriteApplicationEntry(long term, ApplicationEntry entry, org.agrona.MutableDirectBuffer buffer, int offset) Writes the term and entry into given buffer at the given offsetintwriteConfigurationEntry(long term, ConfigurationEntry entry, org.agrona.MutableDirectBuffer buffer, int offset) Writes the term and entry into given buffer at the given offsetintwriteInitialEntry(long term, InitialEntry entry, org.agrona.MutableDirectBuffer buffer, int offset) Writes the term and entry into given buffer at the given offset
-
Method Details
-
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 entryentry- the ApplicationEntry to writebuffer- the buffer to write tooffset- 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 entryentry- the InitialEntry to writebuffer- the buffer to write tooffset- 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 entryentry- the ApplicationEntry to writebuffer- the buffer to write tooffset- the offset in the buffer at which the term and entry will be written- Returns:
- the number of bytes written
-
readRaftLogEntry
Read the raft log entry from the buffer- Parameters:
buffer-- Returns:
- RaftLogEntry
-