LogCabin
|
This is returned by getNextEntry(). More...
#include <RaftConsensus.h>
Public Types | |
enum | { DATA, SNAPSHOT, SKIP } |
The type of the entry. More... | |
Public Member Functions | |
Entry () | |
Default constructor. | |
Entry (Entry &&other) | |
Move constructor. | |
~Entry () | |
Destructor. | |
Entry (const Entry &) | |
Entry & | operator= (const Entry &) |
Public Attributes | |
uint64_t | index |
The Raft log index for this entry (or the last one a snapshot covers). | |
enum LogCabin::Server::RaftConsensus::Entry:: { ... } | type |
The type of the entry. | |
Core::Buffer | command |
The client request for entries of type 'DATA'. | |
std::unique_ptr < Storage::SnapshotFile::Reader > | snapshotReader |
A handle to the snapshot file for entries of type 'SNAPSHOT'. | |
uint64_t | clusterTime |
Cluster time when leader created entry/snapshot. |
This is returned by getNextEntry().
Definition at line 899 of file RaftConsensus.h.
anonymous enum |
The type of the entry.
DATA |
This is a normal entry containing a client request for the state machine. The 'data' field contains that request, and 'snapshotReader' is not set. |
SNAPSHOT |
This is a snapshot: the state machine should clear its state and load in the snapshot. The 'data' field is not set, and the 'snapshotReader' should be used to read the snapshot contents from. |
SKIP |
Some entries should be ignored by the state machine (they are consumed internally by the consensus module). For client service threads to know when a state machine is up-to-date, it's easiest for the state machine to get empty entries back for these, and simply call back into getNextEntry() again with the next ID, Entries of type 'SKIP' will have neither 'data' nor 'snapshotReader' set. |
Definition at line 917 of file RaftConsensus.h.
Default constructor.
Definition at line 909 of file RaftConsensus.cc.
LogCabin::Server::RaftConsensus::Entry::Entry | ( | Entry && | other | ) |
Move constructor.
Definition at line 918 of file RaftConsensus.cc.
Destructor.
Definition at line 927 of file RaftConsensus.cc.
LogCabin::Server::RaftConsensus::Entry::Entry | ( | const Entry & | ) |
The Raft log index for this entry (or the last one a snapshot covers).
Pass this as the lastIndex argument to the next call to getNextEntry().
Definition at line 912 of file RaftConsensus.h.
enum { ... } LogCabin::Server::RaftConsensus::Entry::type |
The type of the entry.
The client request for entries of type 'DATA'.
Definition at line 946 of file RaftConsensus.h.
std::unique_ptr<Storage::SnapshotFile::Reader> LogCabin::Server::RaftConsensus::Entry::snapshotReader |
A handle to the snapshot file for entries of type 'SNAPSHOT'.
Definition at line 951 of file RaftConsensus.h.
Cluster time when leader created entry/snapshot.
This is valid for entries of all types.
Definition at line 957 of file RaftConsensus.h.