CCF
Loading...
Searching...
No Matches
visit_each_entry_in_map.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#include "ccf/byte_vector.h"
7#include "ccf/pal/locking.h"
8
10{
11 // A meta-strategy which takes a target map, requests every Tx in-order, and
12 // visits each written KV pair in the target map in each Tx. Derived classes
13 // override visit_entry() to construct/store their index.
15 {
16 protected:
17 std::string map_name;
18
19 // Protect access to current_txid
21
23
24 virtual void visit_entry(
25 const ccf::TxID& tx_id,
26 const ccf::ByteVector& k,
27 const ccf::ByteVector& v) = 0;
28
29 public:
31 const std::string& map_name_,
32 const std::string& strategy_prefix = "VisitEachEntryIn");
33
34 virtual ~VisitEachEntryInMap() = default;
35
37 const ccf::TxID& tx_id, const ccf::kv::ReadOnlyStorePtr& store) override;
38 std::optional<ccf::SeqNo> next_requested() override;
39
40 nlohmann::json describe() override;
41
43 };
44}
Definition strategy.h:24
Definition visit_each_entry_in_map.h:15
virtual void visit_entry(const ccf::TxID &tx_id, const ccf::ByteVector &k, const ccf::ByteVector &v)=0
void handle_committed_transaction(const ccf::TxID &tx_id, const ccf::kv::ReadOnlyStorePtr &store) override
Definition visit_each_entry_in_map.cpp:16
nlohmann::json describe() override
Definition visit_each_entry_in_map.cpp:38
std::optional< ccf::SeqNo > next_requested() override
Definition visit_each_entry_in_map.cpp:32
ccf::TxID current_txid
Definition visit_each_entry_in_map.h:22
ccf::TxID get_indexed_watermark()
Definition visit_each_entry_in_map.cpp:46
std::string map_name
Definition visit_each_entry_in_map.h:17
ccf::pal::Mutex current_txid_lock
Definition visit_each_entry_in_map.h:20
Definition seqnos_by_key_bucketed.h:10
std::shared_ptr< ReadOnlyStore > ReadOnlyStorePtr
Definition read_only_store.h:23
std::mutex Mutex
Definition locking.h:12
llvm_vecsmall::SmallVector< uint8_t, 8 > ByteVector
Definition byte_vector.h:14
Definition tx_id.h:44