CCF
|
#include <strategy.h>
Inherited by ccf::indexing::strategies::VisitEachEntryInMap, and loggingapp::CommittedRecords.
Public Member Functions | |
Strategy (const std::string &name) | |
virtual | ~Strategy ()=default |
std::string | get_name () const |
virtual void | handle_committed_transaction (const ccf::TxID &tx_id, const ccf::kv::ReadOnlyStorePtr &store)=0 |
virtual void | tick () |
virtual std::optional< ccf::SeqNo > | next_requested ()=0 |
virtual nlohmann::json | describe () |
The base class for all indexing strategies.
Sub-class this and override handle_committed_transaction to implement your own indexing strategy. Create an instance of this on each node, and then install it with context.get_indexing_strategies().install_strategy(). It will then be given each committed transaction shortly after commit. You should build some aggregate/summary from these transactions, and return that to endpoint handlers in an efficient format.
|
inline |
|
virtualdefault |
|
inlinevirtual |
|
inline |
|
pure virtual |
Receives every committed transaction, in-order, shortly after commit.
The given store contains only the changes that occured in the current transaction.
Implemented in ccf::indexing::strategies::VisitEachEntryInMap, and loggingapp::CommittedRecords.
|
pure virtual |
Returns next tx for which this index should be populated, or nullopt if it wants none. Allows indexes to be populated lazily on-demand, or out-of-order, or reset
Implemented in ccf::indexing::strategies::VisitEachEntryInMap, and loggingapp::CommittedRecords.
|
inlinevirtual |