CCF
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
aft::Aft< LedgerProxy > Class Template Reference

#include <raft.h>

Inherits ccf::kv::Consensus.

Public Member Functions

 Aft (const ccf::consensus::Configuration &settings_, std::unique_ptr< Store > store_, std::unique_ptr< LedgerProxy > ledger_, std::shared_ptr< ccf::NodeToNode > channels_, std::shared_ptr< aft::State > state_, std::shared_ptr< ccf::NodeClient > rpc_request_context_, bool public_only_=false, ccf::kv::MembershipState initial_membership_state_=ccf::kv::MembershipState::Active, ccf::ReconfigurationType reconfiguration_type_=ccf::ReconfigurationType::ONE_TRANSACTION)
 
virtual ~Aft ()=default
 
std::optional< ccf::NodeIdprimary () override
 
ccf::NodeId id () override
 
bool is_primary () override
 
bool is_candidate () override
 
bool can_replicate () override
 
bool is_at_max_capacity () override
 
Consensus::SignatureDisposition get_signature_disposition () override
 
bool is_backup () override
 
bool is_active () const
 
bool is_retired () const
 
bool is_retired_committed () const
 
bool is_retired_completed () const
 
void set_retired_committed (ccf::SeqNo seqno, const std::vector< ccf::kv::NodeId > &node_ids) override
 
Index last_committable_index () const
 
std::optional< Indexfind_highest_possible_committable_index (Index idx) const
 
void compact_committable_indices (Index idx)
 
void enable_all_domains () override
 
void force_become_primary () override
 
void force_become_primary (Index index, Term term, const std::vector< Index > &terms, Index commit_idx_) override
 
void init_as_backup (Index index, Term term, const std::vector< Index > &term_history, Index recovery_start_index=0) override
 
Index get_last_idx ()
 
Index get_committed_seqno () override
 
Term get_view () override
 
std::pair< Term, Indexget_committed_txid () override
 
Term get_view (Index idx) override
 
std::vector< Indexget_view_history (Index idx) override
 
std::vector< Indexget_view_history_since (Index idx) override
 
std::set< ccf::NodeIdother_nodes_in_active_configs () const
 
void add_configuration (Index idx, const ccf::kv::Configuration::Nodes &conf, const std::unordered_set< ccf::NodeId > &new_learner_nodes={}, const std::unordered_set< ccf::NodeId > &new_retired_nodes={}) override
 
void start_ticking ()
 
void reset_last_ack_timeouts ()
 
Configuration::Nodes get_latest_configuration_unsafe () const override
 
Configuration::Nodes get_latest_configuration () override
 
ccf::kv::ConsensusDetails get_details () override
 
bool replicate (const ccf::kv::BatchVector &entries, Term term) override
 
void recv_message (const ccf::NodeId &from, const uint8_t *data, size_t size) override
 
void periodic (std::chrono::milliseconds elapsed) override
 
void become_follower ()
 
void become_aware_of_new_term (Term term)
 
void rollback (Index idx)
 
nlohmann::json get_state_representation () const
 
- Public Member Functions inherited from ccf::kv::Consensus
virtual ~Consensus ()
 
virtual void periodic_end ()
 

Public Attributes

std::unique_ptr< LedgerProxy > ledger
 
std::shared_ptr< ccf::NodeToNodechannels
 

Static Public Attributes

static constexpr size_t append_entries_size_limit = 20000
 

Additional Inherited Members

- Public Types inherited from ccf::kv::Consensus
enum class  SignatureDisposition { CANT_REPLICATE , CAN_SIGN , SHOULD_SIGN }
 

Constructor & Destructor Documentation

◆ Aft()

template<class LedgerProxy >
aft::Aft< LedgerProxy >::Aft ( const ccf::consensus::Configuration settings_,
std::unique_ptr< Store store_,
std::unique_ptr< LedgerProxy >  ledger_,
std::shared_ptr< ccf::NodeToNode channels_,
std::shared_ptr< aft::State state_,
std::shared_ptr< ccf::NodeClient rpc_request_context_,
bool  public_only_ = false,
ccf::kv::MembershipState  initial_membership_state_ = ccf::kv::MembershipState::Active,
ccf::ReconfigurationType  reconfiguration_type_ = ccf::ReconfigurationType::ONE_TRANSACTION 
)
inline

◆ ~Aft()

template<class LedgerProxy >
virtual aft::Aft< LedgerProxy >::~Aft ( )
virtualdefault

Member Function Documentation

◆ add_configuration()

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::add_configuration ( Index  idx,
const ccf::kv::Configuration::Nodes conf,
const std::unordered_set< ccf::NodeId > &  new_learner_nodes = {},
const std::unordered_set< ccf::NodeId > &  new_retired_nodes = {} 
)
inlineoverridevirtual

◆ become_aware_of_new_term()

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::become_aware_of_new_term ( Term  term)
inline

◆ become_follower()

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::become_follower ( )
inline

◆ can_replicate()

template<class LedgerProxy >
bool aft::Aft< LedgerProxy >::can_replicate ( )
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ compact_committable_indices()

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::compact_committable_indices ( Index  idx)
inline

◆ enable_all_domains()

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::enable_all_domains ( )
inlineoverridevirtual

Reimplemented from ccf::kv::Consensus.

◆ find_highest_possible_committable_index()

template<class LedgerProxy >
std::optional< Index > aft::Aft< LedgerProxy >::find_highest_possible_committable_index ( Index  idx) const
inline

◆ force_become_primary() [1/2]

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::force_become_primary ( )
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ force_become_primary() [2/2]

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::force_become_primary ( Index  index,
Term  term,
const std::vector< Index > &  terms,
Index  commit_idx_ 
)
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ get_committed_seqno()

template<class LedgerProxy >
Index aft::Aft< LedgerProxy >::get_committed_seqno ( )
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ get_committed_txid()

template<class LedgerProxy >
std::pair< Term, Index > aft::Aft< LedgerProxy >::get_committed_txid ( )
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ get_details()

template<class LedgerProxy >
ccf::kv::ConsensusDetails aft::Aft< LedgerProxy >::get_details ( )
inlineoverridevirtual

◆ get_last_idx()

template<class LedgerProxy >
Index aft::Aft< LedgerProxy >::get_last_idx ( )
inline

◆ get_latest_configuration()

template<class LedgerProxy >
Configuration::Nodes aft::Aft< LedgerProxy >::get_latest_configuration ( )
inlineoverridevirtual

◆ get_latest_configuration_unsafe()

template<class LedgerProxy >
Configuration::Nodes aft::Aft< LedgerProxy >::get_latest_configuration_unsafe ( ) const
inlineoverridevirtual

◆ get_signature_disposition()

template<class LedgerProxy >
Consensus::SignatureDisposition aft::Aft< LedgerProxy >::get_signature_disposition ( )
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ get_state_representation()

template<class LedgerProxy >
nlohmann::json aft::Aft< LedgerProxy >::get_state_representation ( ) const
inline

◆ get_view() [1/2]

template<class LedgerProxy >
Term aft::Aft< LedgerProxy >::get_view ( )
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ get_view() [2/2]

template<class LedgerProxy >
Term aft::Aft< LedgerProxy >::get_view ( Index  idx)
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ get_view_history()

template<class LedgerProxy >
std::vector< Index > aft::Aft< LedgerProxy >::get_view_history ( Index  idx)
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ get_view_history_since()

template<class LedgerProxy >
std::vector< Index > aft::Aft< LedgerProxy >::get_view_history_since ( Index  idx)
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ id()

template<class LedgerProxy >
ccf::NodeId aft::Aft< LedgerProxy >::id ( )
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ init_as_backup()

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::init_as_backup ( Index  index,
Term  term,
const std::vector< Index > &  term_history,
Index  recovery_start_index = 0 
)
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ is_active()

template<class LedgerProxy >
bool aft::Aft< LedgerProxy >::is_active ( ) const
inline

◆ is_at_max_capacity()

template<class LedgerProxy >
bool aft::Aft< LedgerProxy >::is_at_max_capacity ( )
inlineoverridevirtual

Returns true if the node is primary, max_uncommitted_tx_count is non-zero and the number of transactions replicated but not yet committed exceeds max_uncommitted_tx_count.

Implements ccf::kv::Consensus.

◆ is_backup()

template<class LedgerProxy >
bool aft::Aft< LedgerProxy >::is_backup ( )
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ is_candidate()

template<class LedgerProxy >
bool aft::Aft< LedgerProxy >::is_candidate ( )
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ is_primary()

template<class LedgerProxy >
bool aft::Aft< LedgerProxy >::is_primary ( )
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ is_retired()

template<class LedgerProxy >
bool aft::Aft< LedgerProxy >::is_retired ( ) const
inline

◆ is_retired_committed()

template<class LedgerProxy >
bool aft::Aft< LedgerProxy >::is_retired_committed ( ) const
inline

◆ is_retired_completed()

template<class LedgerProxy >
bool aft::Aft< LedgerProxy >::is_retired_completed ( ) const
inline

◆ last_committable_index()

template<class LedgerProxy >
Index aft::Aft< LedgerProxy >::last_committable_index ( ) const
inline

◆ other_nodes_in_active_configs()

template<class LedgerProxy >
std::set< ccf::NodeId > aft::Aft< LedgerProxy >::other_nodes_in_active_configs ( ) const
inline

◆ periodic()

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::periodic ( std::chrono::milliseconds  elapsed)
inlineoverridevirtual

Reimplemented from ccf::kv::Consensus.

◆ primary()

template<class LedgerProxy >
std::optional< ccf::NodeId > aft::Aft< LedgerProxy >::primary ( )
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ recv_message()

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::recv_message ( const ccf::NodeId from,
const uint8_t *  data,
size_t  size 
)
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ replicate()

template<class LedgerProxy >
bool aft::Aft< LedgerProxy >::replicate ( const ccf::kv::BatchVector entries,
Term  term 
)
inlineoverridevirtual

Implements ccf::kv::Consensus.

◆ reset_last_ack_timeouts()

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::reset_last_ack_timeouts ( )
inline

◆ rollback()

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::rollback ( Index  idx)
inline

◆ set_retired_committed()

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::set_retired_committed ( ccf::SeqNo  seqno,
const std::vector< ccf::kv::NodeId > &  node_ids 
)
inlineoverridevirtual

Reimplemented from ccf::kv::Consensus.

◆ start_ticking()

template<class LedgerProxy >
void aft::Aft< LedgerProxy >::start_ticking ( )
inline

Member Data Documentation

◆ append_entries_size_limit

template<class LedgerProxy >
constexpr size_t aft::Aft< LedgerProxy >::append_entries_size_limit = 20000
staticconstexpr

◆ channels

template<class LedgerProxy >
std::shared_ptr<ccf::NodeToNode> aft::Aft< LedgerProxy >::channels

◆ ledger

template<class LedgerProxy >
std::unique_ptr<LedgerProxy> aft::Aft< LedgerProxy >::ledger

The documentation for this class was generated from the following file: