LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Public Attributes
LogCabin::Server::RaftConsensus::Entry Struct Reference

This is returned by getNextEntry(). More...

#include <RaftConsensus.h>

List of all members.

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 &)
Entryoperator= (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.

Detailed Description

This is returned by getNextEntry().

Definition at line 899 of file RaftConsensus.h.


Member Enumeration Documentation

anonymous enum

The type of the entry.

Enumerator:
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.


Constructor & Destructor Documentation

Default constructor.

Definition at line 909 of file RaftConsensus.cc.

Move constructor.

Definition at line 918 of file RaftConsensus.cc.

Destructor.

Definition at line 927 of file RaftConsensus.cc.


Member Function Documentation

Entry& LogCabin::Server::RaftConsensus::Entry::operator= ( const Entry )

Member Data Documentation

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.

The type of the entry.

The client request for entries of type 'DATA'.

Definition at line 946 of file RaftConsensus.h.

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.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines