Interface RaftEntrySerializer
- All Known Implementing Classes:
RaftEntrySBESerializer
public interface RaftEntrySerializer
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA buffer writer based on serializer logic provided as functions. -
Method Summary
Modifier and TypeMethodDescriptionintDetermines the length in bytes of a serialized application entry.intDetermines the length in bytes of a serialized configuration entry.intDetermines the length in bytes of a serialized initial entry.readRaftLogEntry(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
-
getApplicationEntrySerializedLength
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
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 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 ConfigurationEntry 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- to read the raft log entry from- Returns:
- RaftLogEntry
-