CCF
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
ccf::kv Namespace Reference

Namespaces

namespace  serialisers
 
namespace  untyped
 

Classes

struct  AbstractChangeContainer
 
class  AbstractChangeSet
 
class  AbstractCommitter
 
class  AbstractExecutionWrapper
 
class  AbstractHandle
 
class  AbstractMap
 
class  AbstractSnapshotter
 
class  AbstractStore
 
class  AbstractTxEncryptor
 
class  BaseTx
 
class  CFTExecutionWrapper
 
class  CommittableTx
 
class  CompactedVersionConflict
 
class  ConfigurableConsensus
 
struct  Configuration
 
class  Consensus
 
struct  ConsensusDetails
 
class  ConsensusHook
 
struct  ConsensusParameters
 
class  ExecutionWrapperStore
 
class  GenericDeserialiseWrapper
 
class  GenericSerialiseWrapper
 
struct  GetName
 
struct  ILedgerChunker
 
class  KvSerialiserException
 
struct  LedgerChunker
 
struct  MapChanges
 
class  MapDiff
 
class  MapHandle
 
class  MovePendingTx
 
class  PendingTx
 
struct  PendingTxInfo
 
class  RawReader
 
class  RawWriter
 
class  ReadableMapHandle
 
class  ReadableSetHandle
 
class  ReadableValueHandle
 
class  ReadOnlyStore
 
class  ReadOnlyTx
 
class  ReservedTx
 
class  ScopedStoreMapsLock
 
struct  SerialisedEntryHeader
 
class  SetHandle
 
class  Store
 
class  StoreSnapshot
 
class  StoreState
 
class  Tx
 
class  TxDiff
 
class  TxEncryptor
 
class  TxHistory
 
struct  TxID
 
class  TypedMap
 
class  TypedSet
 
class  TypedValue
 
class  ValueHandle
 
struct  VersionV
 
class  WriteableMapHandle
 
class  WriteableSetHandle
 
class  WriteableValueHandle
 

Typedefs

using ConsensusHookPtr = std::unique_ptr< ConsensusHook >
 
using ConsensusHookPtrs = std::vector< ConsensusHookPtr >
 
template<typename TWrites >
using CommitHook = std::function< void(Version, const TWrites &)>
 Signature for transaction commit handlers.
 
template<typename TWrites >
using MapHook = std::function< std::unique_ptr< ConsensusHook >(Version, const TWrites &)>
 
template<typename K , typename V , template< typename > typename KSerialiser, template< typename > typename VSerialiser = KSerialiser>
using MapSerialisedWith = TypedMap< K, V, KSerialiser< K >, VSerialiser< V > >
 
template<typename K , typename V >
using JsonSerialisedMap = MapSerialisedWith< K, V, ccf::kv::serialisers::JsonSerialiser >
 
template<typename K , typename V >
using RawCopySerialisedMap = TypedMap< K, V, ccf::kv::serialisers::BlitSerialiser< K >, ccf::kv::serialisers::BlitSerialiser< V > >
 
template<typename K , typename V >
using Map = JsonSerialisedMap< K, V >
 
using ReadOnlyStorePtr = std::shared_ptr< ReadOnlyStore >
 
template<typename K , template< typename > typename KSerialiser, typename Unit = ccf::kv::serialisers::ZeroBlitUnitCreator>
using SetSerialisedWith = TypedSet< K, KSerialiser< K >, Unit >
 
template<typename K >
using JsonSerialisedSet = SetSerialisedWith< K, ccf::kv::serialisers::JsonSerialiser >
 
template<typename K >
using RawCopySerialisedSet = TypedSet< K, ccf::kv::serialisers::BlitSerialiser< K > >
 
template<typename K >
using Set = JsonSerialisedSet< K >
 
template<typename V , template< typename > typename VSerialiser, typename Unit = ccf::kv::serialisers::ZeroBlitUnitCreator>
using ValueSerialisedWith = TypedValue< V, VSerialiser< V >, Unit >
 
template<typename V >
using JsonSerialisedValue = ValueSerialisedWith< V, ccf::kv::serialisers::JsonSerialiser >
 
template<typename V >
using RawCopySerialisedValue = TypedValue< V, ccf::kv::serialisers::BlitSerialiser< V > >
 
template<typename V >
using Value = JsonSerialisedValue< V >
 
using Version = uint64_t
 
using OrderedChanges = std::map< std::string, MapChanges >
 
using MapCollection = std::map< std::string, std::shared_ptr< AbstractMap > >
 
using VersionLastNewMap = Version
 
using VersionResolver = std::function< std::tuple< Version, VersionLastNewMap >(bool tx_contains_new_map)>
 
using SerialisedKey = ccf::kv::serialisers::SerialisedEntry
 
using SerialisedValue = ccf::kv::serialisers::SerialisedEntry
 
using Term = uint64_t
 
using NodeId = ccf::NodeId
 
using ReconfigurationId = uint64_t
 
using BatchVector = std::vector< std::tuple< Version, std::shared_ptr< std::vector< uint8_t > >, bool, std::shared_ptr< ConsensusHookPtrs > > >
 
using EncryptorPtr = std::shared_ptr< AbstractTxEncryptor >
 
using SnapshotterPtr = std::shared_ptr< AbstractSnapshotter >
 
using SerialisedEntryFlags = uint8_t
 
using KvStoreSerialiser = GenericSerialiseWrapper< RawWriter >
 
using KvStoreDeserialiser = GenericDeserialiseWrapper< RawReader >
 
using StorePtr = std::shared_ptr< ccf::kv::Store >
 

Enumerations

enum class  LeadershipState { None , Leader , Follower , Candidate }
 
enum class  MembershipState { Active , Retired }
 
enum class  RetirementPhase { Ordered = 1 , Signed = 2 , Completed = 3 , RetiredCommitted = 4 }
 
enum  CommitResult { SUCCESS = 1 , FAIL_CONFLICT = 2 , FAIL_NO_REPLICATE = 3 }
 
enum  SecurityDomain { PUBLIC , PRIVATE , SECURITY_DOMAIN_MAX }
 
enum  AccessCategory { INTERNAL , GOVERNANCE , APPLICATION }
 
enum class  EntryType : uint8_t {
  WriteSet = 0 , Snapshot = 1 , WriteSetWithClaims = 2 , WriteSetWithCommitEvidence = 3 ,
  WriteSetWithCommitEvidenceAndClaims = 4 , MAX = WriteSetWithCommitEvidenceAndClaims
}
 
enum  ApplyResult {
  PASS = 1 , PASS_SIGNATURE = 2 , PASS_BACKUP_SIGNATURE = 3 , PASS_BACKUP_SIGNATURE_SEND_ACK = 4 ,
  PASS_NONCES = 5 , PASS_NEW_VIEW = 6 , PASS_ENCRYPTED_PAST_LEDGER_SECRET = 8 , PASS_APPLY = 9 ,
  FAIL = 10
}
 
enum  EntryFlags : SerialisedEntryFlags { FORCE_LEDGER_CHUNK_AFTER = 0x01 , FORCE_LEDGER_CHUNK_BEFORE = 0x02 }
 

Functions

 DECLARE_JSON_TYPE (TxID)
 
void to_json (nlohmann::json &j, const Configuration::NodeInfo &ni)
 
void from_json (const nlohmann::json &j, Configuration::NodeInfo &ni)
 
std::string schema_name (const Configuration::NodeInfo *)
 
void fill_json_schema (nlohmann::json &schema, const Configuration::NodeInfo *)
 
 DECLARE_JSON_ENUM (LeadershipState, {{LeadershipState::None, "None"}, {LeadershipState::Leader, "Leader"}, {LeadershipState::Follower, "Follower"}, {LeadershipState::Candidate, "Candidate"}})
 
 DECLARE_JSON_ENUM (MembershipState, {{MembershipState::Active, "Active"}, {MembershipState::Retired, "Retired"}})
 
 DECLARE_JSON_ENUM (RetirementPhase, {{RetirementPhase::Ordered, "Ordered"}, {RetirementPhase::Signed, "Signed"}, {RetirementPhase::Completed, "Completed"}, {RetirementPhase::RetiredCommitted, "RetiredCommitted"}})
 
 DECLARE_JSON_TYPE (Configuration)
 
 DECLARE_JSON_REQUIRED_FIELDS (Configuration, idx, nodes, rid)
 
 DECLARE_JSON_TYPE (ConsensusDetails::Ack)
 
 DECLARE_JSON_REQUIRED_FIELDS (ConsensusDetails::Ack, seqno, last_received_ms)
 
 DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS (ConsensusDetails)
 
 DECLARE_JSON_REQUIRED_FIELDS (ConsensusDetails, configs, acks, membership_state, primary_id, current_view, ticking)
 
 DECLARE_JSON_OPTIONAL_FIELDS (ConsensusDetails, reconfiguration_type, learners, leadership_state, retirement_phase)
 

Variables

constexpr auto public_domain_prefix = "public:"
 

Typedef Documentation

◆ BatchVector

using ccf::kv::BatchVector = typedef std::vector<std::tuple< Version, std::shared_ptr<std::vector<uint8_t> >, bool, std::shared_ptr<ConsensusHookPtrs> >>

◆ CommitHook

template<typename TWrites >
using ccf::kv::CommitHook = typedef std::function<void(Version, const TWrites&)>

Signature for transaction commit handlers.

◆ ConsensusHookPtr

using ccf::kv::ConsensusHookPtr = typedef std::unique_ptr<ConsensusHook>

◆ ConsensusHookPtrs

using ccf::kv::ConsensusHookPtrs = typedef std::vector<ConsensusHookPtr>

◆ EncryptorPtr

using ccf::kv::EncryptorPtr = typedef std::shared_ptr<AbstractTxEncryptor>

◆ JsonSerialisedMap

template<typename K , typename V >
using ccf::kv::JsonSerialisedMap = typedef MapSerialisedWith<K, V, ccf::kv::serialisers::JsonSerialiser>

◆ JsonSerialisedSet

◆ JsonSerialisedValue

◆ KvStoreDeserialiser

◆ KvStoreSerialiser

◆ Map

template<typename K , typename V >
using ccf::kv::Map = typedef JsonSerialisedMap<K, V>

Short name for default-serialised maps, using JSON serialisers. Support for custom types can be added through the DECLARE_JSON... macros.

◆ MapCollection

using ccf::kv::MapCollection = typedef std::map<std::string, std::shared_ptr<AbstractMap> >

◆ MapHook

template<typename TWrites >
using ccf::kv::MapHook = typedef std::function<std::unique_ptr<ConsensusHook>(Version, const TWrites&)>

◆ MapSerialisedWith

template<typename K , typename V , template< typename > typename KSerialiser, template< typename > typename VSerialiser = KSerialiser>
using ccf::kv::MapSerialisedWith = typedef TypedMap<K, V, KSerialiser<K>, VSerialiser<V> >

◆ NodeId

using ccf::kv::NodeId = typedef ccf::NodeId

◆ OrderedChanges

using ccf::kv::OrderedChanges = typedef std::map<std::string, MapChanges>

◆ RawCopySerialisedMap

◆ RawCopySerialisedSet

template<typename K >
using ccf::kv::RawCopySerialisedSet = typedef TypedSet<K, ccf::kv::serialisers::BlitSerialiser<K> >

◆ RawCopySerialisedValue

◆ ReadOnlyStorePtr

using ccf::kv::ReadOnlyStorePtr = typedef std::shared_ptr<ReadOnlyStore>

◆ ReconfigurationId

using ccf::kv::ReconfigurationId = typedef uint64_t

◆ SerialisedEntryFlags

using ccf::kv::SerialisedEntryFlags = typedef uint8_t

◆ SerialisedKey

◆ SerialisedValue

◆ Set

template<typename K >
using ccf::kv::Set = typedef JsonSerialisedSet<K>

Short name for default-serialised sets, using JSON serialisers. Support for custom types can be added through the DECLARE_JSON... macros.

◆ SetSerialisedWith

template<typename K , template< typename > typename KSerialiser, typename Unit = ccf::kv::serialisers::ZeroBlitUnitCreator>
using ccf::kv::SetSerialisedWith = typedef TypedSet<K, KSerialiser<K>, Unit>

◆ SnapshotterPtr

using ccf::kv::SnapshotterPtr = typedef std::shared_ptr<AbstractSnapshotter>

◆ StorePtr

using ccf::kv::StorePtr = typedef std::shared_ptr<ccf::kv::Store>

◆ Term

using ccf::kv::Term = typedef uint64_t

◆ Value

template<typename V >
using ccf::kv::Value = typedef JsonSerialisedValue<V>

Short name for default-serialised values, using JSON serialisers. Support for custom types can be added through the DECLARE_JSON... macros.

◆ ValueSerialisedWith

template<typename V , template< typename > typename VSerialiser, typename Unit = ccf::kv::serialisers::ZeroBlitUnitCreator>
using ccf::kv::ValueSerialisedWith = typedef TypedValue<V, VSerialiser<V>, Unit>

◆ Version

typedef uint64_t ccf::kv::Version

◆ VersionLastNewMap

◆ VersionResolver

using ccf::kv::VersionResolver = typedef std::function<std::tuple<Version, VersionLastNewMap>( bool tx_contains_new_map)>

Enumeration Type Documentation

◆ AccessCategory

Enumerator
INTERNAL 
GOVERNANCE 
APPLICATION 

◆ ApplyResult

Enumerator
PASS 
PASS_SIGNATURE 
PASS_BACKUP_SIGNATURE 
PASS_BACKUP_SIGNATURE_SEND_ACK 
PASS_NONCES 
PASS_NEW_VIEW 
PASS_ENCRYPTED_PAST_LEDGER_SECRET 
PASS_APPLY 
FAIL 

◆ CommitResult

Enumerator
SUCCESS 
FAIL_CONFLICT 
FAIL_NO_REPLICATE 

◆ EntryFlags

Enumerator
FORCE_LEDGER_CHUNK_AFTER 
FORCE_LEDGER_CHUNK_BEFORE 

◆ EntryType

enum class ccf::kv::EntryType : uint8_t
strong
Enumerator
WriteSet 
Snapshot 
WriteSetWithClaims 
WriteSetWithCommitEvidence 
WriteSetWithCommitEvidenceAndClaims 
MAX 

◆ LeadershipState

enum class ccf::kv::LeadershipState
strong
Enumerator
None 
Leader 
Follower 
Candidate 

◆ MembershipState

enum class ccf::kv::MembershipState
strong
Enumerator
Active 
Retired 

◆ RetirementPhase

enum class ccf::kv::RetirementPhase
strong
Enumerator
Ordered 
Signed 
Completed 
RetiredCommitted 

◆ SecurityDomain

Enumerator
PUBLIC 
PRIVATE 
SECURITY_DOMAIN_MAX 

Function Documentation

◆ DECLARE_JSON_ENUM() [1/3]

ccf::kv::DECLARE_JSON_ENUM ( LeadershipState  ,
{{LeadershipState::None, "None"}, {LeadershipState::Leader, "Leader"}, {LeadershipState::Follower, "Follower"}, {LeadershipState::Candidate, "Candidate"}}   
)

◆ DECLARE_JSON_ENUM() [2/3]

ccf::kv::DECLARE_JSON_ENUM ( MembershipState  ,
{{MembershipState::Active, "Active"}, {MembershipState::Retired, "Retired"}}   
)

◆ DECLARE_JSON_ENUM() [3/3]

ccf::kv::DECLARE_JSON_ENUM ( RetirementPhase  ,
{{RetirementPhase::Ordered, "Ordered"}, {RetirementPhase::Signed, "Signed"}, {RetirementPhase::Completed, "Completed"}, {RetirementPhase::RetiredCommitted, "RetiredCommitted"}}   
)

◆ DECLARE_JSON_OPTIONAL_FIELDS()

ccf::kv::DECLARE_JSON_OPTIONAL_FIELDS ( ConsensusDetails  ,
reconfiguration_type  ,
learners  ,
leadership_state  ,
retirement_phase   
)

◆ DECLARE_JSON_REQUIRED_FIELDS() [1/3]

ccf::kv::DECLARE_JSON_REQUIRED_FIELDS ( Configuration  ,
idx  ,
nodes  ,
rid   
)

◆ DECLARE_JSON_REQUIRED_FIELDS() [2/3]

ccf::kv::DECLARE_JSON_REQUIRED_FIELDS ( ConsensusDetails  ,
configs  ,
acks  ,
membership_state  ,
primary_id  ,
current_view  ,
ticking   
)

◆ DECLARE_JSON_REQUIRED_FIELDS() [3/3]

ccf::kv::DECLARE_JSON_REQUIRED_FIELDS ( ConsensusDetails::Ack  ,
seqno  ,
last_received_ms   
)

◆ DECLARE_JSON_TYPE() [1/3]

ccf::kv::DECLARE_JSON_TYPE ( Configuration  )

◆ DECLARE_JSON_TYPE() [2/3]

ccf::kv::DECLARE_JSON_TYPE ( ConsensusDetails::Ack  )

◆ DECLARE_JSON_TYPE() [3/3]

ccf::kv::DECLARE_JSON_TYPE ( TxID  )

◆ DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS()

ccf::kv::DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS ( ConsensusDetails  )

◆ fill_json_schema()

void ccf::kv::fill_json_schema ( nlohmann::json &  schema,
const Configuration::NodeInfo  
)
inline

◆ from_json()

void ccf::kv::from_json ( const nlohmann::json &  j,
Configuration::NodeInfo ni 
)
inline

◆ schema_name()

std::string ccf::kv::schema_name ( const Configuration::NodeInfo )
inline

◆ to_json()

void ccf::kv::to_json ( nlohmann::json &  j,
const Configuration::NodeInfo ni 
)
inline

Variable Documentation

◆ public_domain_prefix

constexpr auto ccf::kv::public_domain_prefix = "public:"
constexpr