CCF
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
aft Namespace Reference

Classes

class  Adaptor
 
class  Aft
 
struct  AppendEntries
 
struct  AppendEntriesResponse
 
struct  ProposeRequestVote
 
struct  RaftHeader
 
class  Replica
 
struct  RequestVote
 
struct  RequestVoteResponse
 
struct  State
 
class  Store
 
class  ViewHistory
 

Typedefs

using Configuration = ccf::kv::Configuration
 
using Index = uint64_t
 
using Term = uint64_t
 
using Node2NodeMsg = uint64_t
 
using Nonce = ccf::crypto::Sha256Hash
 
using ReplyCallback = std::function< bool(void *owner, ccf::kv::TxHistory::RequestID caller_rid, int status, std::vector< uint8_t > &&data)>
 

Enumerations

enum  RaftMsgType : Node2NodeMsg {
  raft_append_entries = 0 , raft_append_entries_response , raft_append_entries_signed_response , raft_request_vote ,
  raft_request_vote_response , raft_propose_request_vote
}
 
enum class  AppendEntriesResponseType : uint8_t { OK = 0 , FAIL = 1 }
 

Functions

 DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS (State)
 
 DECLARE_JSON_REQUIRED_FIELDS (State, node_id, current_view, last_idx, commit_idx, leadership_state, membership_state)
 
 DECLARE_JSON_OPTIONAL_FIELDS (State, retirement_phase, retirement_idx, retirement_committable_idx, retired_committed_idx)
 
 DECLARE_JSON_ENUM (RaftMsgType, { {RaftMsgType::raft_append_entries, "raft_append_entries"}, {RaftMsgType::raft_append_entries_response, "raft_append_entries_response"}, {RaftMsgType::raft_append_entries_signed_response, "raft_append_entries_signed_response"}, {RaftMsgType::raft_request_vote, "raft_request_vote"}, {RaftMsgType::raft_request_vote_response, "raft_request_vote_response"}, {RaftMsgType::raft_propose_request_vote, "raft_propose_request_vote"}, })
 
 DECLARE_JSON_TYPE_WITH_2BASES (AppendEntries, RaftHeader< raft_append_entries >, ::consensus::AppendEntriesIndex)
 
 DECLARE_JSON_REQUIRED_FIELDS (AppendEntries, term, prev_term, leader_commit_idx, term_of_idx, contains_new_view)
 
 DECLARE_JSON_ENUM (AppendEntriesResponseType, {{AppendEntriesResponseType::OK, "OK"}, {AppendEntriesResponseType::FAIL, "FAIL"}})
 
 DECLARE_JSON_TYPE_WITH_BASE (AppendEntriesResponse, RaftHeader< raft_append_entries_response >)
 
 DECLARE_JSON_REQUIRED_FIELDS (AppendEntriesResponse, term, last_log_idx, success)
 
 DECLARE_JSON_TYPE_WITH_BASE (RequestVote, RaftHeader< raft_request_vote >)
 
 DECLARE_JSON_REQUIRED_FIELDS (RequestVote, term, last_committable_idx, term_of_last_committable_idx)
 
 DECLARE_JSON_TYPE_WITH_BASE (RequestVoteResponse, RaftHeader< raft_request_vote_response >)
 
 DECLARE_JSON_REQUIRED_FIELDS (RequestVoteResponse, term, vote_granted)
 
 DECLARE_JSON_TYPE_WITH_BASE (ProposeRequestVote, RaftHeader< raft_propose_request_vote >)
 
 DECLARE_JSON_REQUIRED_FIELDS (ProposeRequestVote, term)
 

Typedef Documentation

◆ Configuration

◆ Index

using aft::Index = typedef uint64_t

◆ Node2NodeMsg

using aft::Node2NodeMsg = typedef uint64_t

◆ Nonce

◆ ReplyCallback

using aft::ReplyCallback = typedef std::function<bool( void* owner, ccf::kv::TxHistory::RequestID caller_rid, int status, std::vector<uint8_t>&& data)>

◆ Term

using aft::Term = typedef uint64_t

Enumeration Type Documentation

◆ AppendEntriesResponseType

enum class aft::AppendEntriesResponseType : uint8_t
strong
Enumerator
OK 
FAIL 

◆ RaftMsgType

Enumerator
raft_append_entries 
raft_append_entries_response 
raft_append_entries_signed_response 
raft_request_vote 
raft_request_vote_response 
raft_propose_request_vote 

Function Documentation

◆ DECLARE_JSON_ENUM() [1/2]

aft::DECLARE_JSON_ENUM ( AppendEntriesResponseType  ,
{{AppendEntriesResponseType::OK, "OK"}, {AppendEntriesResponseType::FAIL, "FAIL"}}   
)

◆ DECLARE_JSON_ENUM() [2/2]

aft::DECLARE_JSON_ENUM ( RaftMsgType  ,
{ {RaftMsgType::raft_append_entries, "raft_append_entries"}, {RaftMsgType::raft_append_entries_response, "raft_append_entries_response"}, {RaftMsgType::raft_append_entries_signed_response, "raft_append_entries_signed_response"}, {RaftMsgType::raft_request_vote, "raft_request_vote"}, {RaftMsgType::raft_request_vote_response, "raft_request_vote_response"}, {RaftMsgType::raft_propose_request_vote, "raft_propose_request_vote"}, }   
)

◆ DECLARE_JSON_OPTIONAL_FIELDS()

aft::DECLARE_JSON_OPTIONAL_FIELDS ( State  ,
retirement_phase  ,
retirement_idx  ,
retirement_committable_idx  ,
retired_committed_idx   
)

◆ DECLARE_JSON_REQUIRED_FIELDS() [1/6]

aft::DECLARE_JSON_REQUIRED_FIELDS ( AppendEntries  ,
term  ,
prev_term  ,
leader_commit_idx  ,
term_of_idx  ,
contains_new_view   
)

◆ DECLARE_JSON_REQUIRED_FIELDS() [2/6]

aft::DECLARE_JSON_REQUIRED_FIELDS ( AppendEntriesResponse  ,
term  ,
last_log_idx  ,
success   
)

◆ DECLARE_JSON_REQUIRED_FIELDS() [3/6]

aft::DECLARE_JSON_REQUIRED_FIELDS ( ProposeRequestVote  ,
term   
)

◆ DECLARE_JSON_REQUIRED_FIELDS() [4/6]

aft::DECLARE_JSON_REQUIRED_FIELDS ( RequestVote  ,
term  ,
last_committable_idx  ,
term_of_last_committable_idx   
)

◆ DECLARE_JSON_REQUIRED_FIELDS() [5/6]

aft::DECLARE_JSON_REQUIRED_FIELDS ( RequestVoteResponse  ,
term  ,
vote_granted   
)

◆ DECLARE_JSON_REQUIRED_FIELDS() [6/6]

aft::DECLARE_JSON_REQUIRED_FIELDS ( State  ,
node_id  ,
current_view  ,
last_idx  ,
commit_idx  ,
leadership_state  ,
membership_state   
)

◆ DECLARE_JSON_TYPE_WITH_2BASES()

aft::DECLARE_JSON_TYPE_WITH_2BASES ( AppendEntries  ,
RaftHeader< raft_append_entries ,
::consensus::AppendEntriesIndex   
)

◆ DECLARE_JSON_TYPE_WITH_BASE() [1/4]

aft::DECLARE_JSON_TYPE_WITH_BASE ( AppendEntriesResponse  ,
RaftHeader< raft_append_entries_response  
)

◆ DECLARE_JSON_TYPE_WITH_BASE() [2/4]

aft::DECLARE_JSON_TYPE_WITH_BASE ( ProposeRequestVote  ,
RaftHeader< raft_propose_request_vote  
)

◆ DECLARE_JSON_TYPE_WITH_BASE() [3/4]

aft::DECLARE_JSON_TYPE_WITH_BASE ( RequestVote  ,
RaftHeader< raft_request_vote  
)

◆ DECLARE_JSON_TYPE_WITH_BASE() [4/4]

aft::DECLARE_JSON_TYPE_WITH_BASE ( RequestVoteResponse  ,
RaftHeader< raft_request_vote_response  
)

◆ DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS()

aft::DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS ( State  )