Class RaftEntrySBESerializer
java.lang.Object
io.atomix.raft.storage.serializer.RaftEntrySBESerializer
- All Implemented Interfaces:
RaftEntrySerializer
-
Constructor Summary
Constructors -
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
-
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:RaftEntrySerializerWrites the term and entry into given buffer at the given offset- Specified by:
writeApplicationEntryin interfaceRaftEntrySerializer- 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
public int writeInitialEntry(long term, InitialEntry entry, org.agrona.MutableDirectBuffer buffer, int offset) Description copied from interface:RaftEntrySerializerWrites the term and entry into given buffer at the given offset- Specified by:
writeInitialEntryin interfaceRaftEntrySerializer- 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
public int writeConfigurationEntry(long term, ConfigurationEntry entry, org.agrona.MutableDirectBuffer buffer, int offset) Description copied from interface:RaftEntrySerializerWrites the term and entry into given buffer at the given offset- Specified by:
writeConfigurationEntryin interfaceRaftEntrySerializer- 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
Description copied from interface:RaftEntrySerializerRead the raft log entry from the buffer- Specified by:
readRaftLogEntryin interfaceRaftEntrySerializer- Returns:
- RaftLogEntry
-