|
| Store (bool strict_versions_=true, bool is_historical_=false) |
|
| Store (const Store &that)=delete |
|
std::shared_ptr< Consensus > | get_consensus () override |
|
void | set_consensus (const std::shared_ptr< Consensus > &consensus_) |
|
std::shared_ptr< TxHistory > | get_history () override |
|
void | set_history (const std::shared_ptr< TxHistory > &history_) |
|
std::shared_ptr< ILedgerChunker > | get_chunker () override |
|
void | set_chunker (const std::shared_ptr< ILedgerChunker > &chunker_) |
|
void | set_encryptor (const EncryptorPtr &encryptor_) |
|
EncryptorPtr | get_encryptor () override |
|
void | set_snapshotter (const SnapshotterPtr &snapshotter_) |
|
std::shared_ptr< AbstractMap > | get_map (ccf::kv::Version v, const std::string &map_name) override |
|
std::shared_ptr< AbstractMap > | get_map_unsafe (ccf::kv::Version v, const std::string &map_name) override |
|
std::shared_ptr< ccf::kv::untyped::Map > | get_map_internal (ccf::kv::Version v, const std::string &map_name) |
|
void | add_dynamic_map (ccf::kv::Version v, const std::shared_ptr< AbstractMap > &map_) override |
|
std::unique_ptr< AbstractSnapshot > | snapshot_unsafe_maps (Version v) override |
|
void | lock_maps () override |
|
void | unlock_maps () override |
|
std::vector< uint8_t > | serialise_snapshot (std::unique_ptr< AbstractSnapshot > snapshot) override |
|
ApplyResult | deserialise_snapshot (const uint8_t *data, size_t size, ccf::kv::ConsensusHookPtrs &hooks, std::vector< Version > *view_history=nullptr, bool public_only=false) override |
|
void | compact (Version v) override |
|
void | rollback (const TxID &tx_id, Term term_of_next_version_) override |
|
void | initialise_term (Term t) override |
|
bool | fill_maps (const std::vector< uint8_t > &data, bool public_only, ccf::kv::Version &v, ccf::kv::Term &view, ccf::kv::EntryFlags &entry_flags, OrderedChanges &changes, MapCollection &new_maps, ccf::ClaimsDigest &claims_digest, std::optional< ccf::crypto::Sha256Hash > &commit_evidence_digest, bool ignore_strict_versions=false) override |
|
std::unique_ptr< ccf::kv::AbstractExecutionWrapper > | deserialize (const std::vector< uint8_t > &data, bool public_only=false, const std::optional< TxID > &expected_txid=std::nullopt) override |
|
bool | operator== (const Store &that) const |
|
Version | current_version () override |
|
ccf::kv::TxID | current_txid () override |
|
ccf::TxID | get_txid () override |
|
std::pair< TxID, Term > | current_txid_and_commit_term () override |
|
Version | compacted_version () override |
|
Term | commit_view () override |
|
CommitResult | commit (const TxID &txid, std::unique_ptr< PendingTx > pending_tx, bool globally_committable) override |
|
bool | should_create_ledger_chunk (Version version) override |
|
bool | should_create_ledger_chunk_unsafe (Version version) override |
|
void | lock_map_set () override |
|
void | unlock_map_set () override |
|
bool | check_rollback_count (Version count) override |
|
std::tuple< Version, Version > | next_version (bool commit_new_map) override |
|
Version | next_version () override |
|
TxID | next_txid () override |
|
size_t | committable_gap () override |
|
void | swap_private_maps (Store &store) |
|
void | set_map_hook (const std::string &map_name, const ccf::kv::untyped::Map::MapHook &hook) |
|
void | unset_map_hook (const std::string &map_name) |
|
void | set_global_hook (const std::string &map_name, const ccf::kv::untyped::Map::CommitHook &hook) |
|
void | unset_global_hook (const std::string &map_name) |
|
ReadOnlyTx | create_read_only_tx () override |
|
std::unique_ptr< ReadOnlyTx > | create_read_only_tx_ptr () override |
|
TxDiff | create_tx_diff () override |
|
CommittableTx | create_tx () |
|
std::unique_ptr< CommittableTx > | create_tx_ptr () |
|
ReservedTx | create_reserved_tx (const TxID &tx_id) |
|
virtual void | set_flag (StoreFlag f) override |
|
virtual void | unset_flag (StoreFlag f) override |
|
virtual bool | flag_enabled (StoreFlag f) override |
|
virtual void | set_flag_unsafe (StoreFlag f) override |
|
virtual void | unset_flag_unsafe (StoreFlag f) override |
|
virtual bool | flag_enabled_unsafe (StoreFlag f) const override |
|
virtual | ~AbstractStore () |
|
void | clear () |
|
virtual | ~ReadOnlyStore ()=default |
|
Get a map by name, iff it exists at the given version.
This means a prior transaction must have created the map, and successfully committed at a version <= v. If this has not happened (the map has never been created, or never been committed, or committed at a later version) this will return nullptr.
- Parameters
-
v | Version at which the map must exist |
map_name | Name of requested map |
- Returns
- Abstract shared-owning pointer to requested map, or nullptr if no such map exists
Implements ccf::kv::AbstractStore.
void ccf::kv::Store::swap_private_maps |
( |
Store & |
store | ) |
|
|
inline |
This is only safe in very restricted circumstances, and is only meant to be used during catastrophic recovery, between a KV with public-state only and a KV with full state, to swap in the private state from the latter into the former.
It's also important to note that swapping in private state may result in previously uncompacted writes becoming effectively compacted, from a user's perspective (they would not be internally compacted until the next compact() however). So it is important to make sure that the private state being swapped in is fully compacted before the swap.