CatapultServer  v0.5.0.1 (Elephant)
RocksPruningFilter.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include <memory>
23 
24 namespace rocksdb { class CompactionFilter; }
25 
26 namespace catapult { namespace cache {
27 
29  enum class FilterPruningMode {
31  Disabled,
32 
34  Enabled
35  };
36 
38  class RocksPruningFilter final {
39  public:
42 
45 
46  public:
48  rocksdb::CompactionFilter* compactionFilter();
49 
51  uint64_t pruningBoundary() const;
52 
54  size_t numRemoved() const;
55 
56  public:
58  void setPruningBoundary(uint64_t pruningBoundary);
59 
60  private:
62  std::unique_ptr<RocksPruningFilterImpl> m_pImpl;
63  };
64 }}
catapult::cache::RocksPruningFilter::~RocksPruningFilter
~RocksPruningFilter()
Destroys rocks pruning filter.
catapult::cache::RocksPruningFilter::m_pImpl
std::unique_ptr< RocksPruningFilterImpl > m_pImpl
Definition: RocksPruningFilter.h:61
catapult::cache::RocksPruningFilter::RocksPruningFilterImpl::setPruningBoundary
void setPruningBoundary(uint64_t compactionBoundary)
Definition: RocksPruningFilter.cpp:62
RocksInclude.h
catapult::cache::RocksPruningFilter::pruningBoundary
uint64_t pruningBoundary() const
Returns pruning boundary.
Definition: RocksPruningFilter.cpp:83
catapult::cache::RocksPruningFilter::numRemoved
size_t numRemoved() const
Returns number of pruned entries since last prune.
Definition: RocksPruningFilter.cpp:87
catapult::cache::RocksPruningFilter::RocksPruningFilterImpl::IgnoreSnapshots
bool IgnoreSnapshots() const override
Definition: RocksPruningFilter.cpp:48
catapult::cache::RocksPruningFilter::compactionFilter
rocksdb::CompactionFilter * compactionFilter()
Returns underlying compaction filter.
Definition: RocksPruningFilter.cpp:79
catapult::cache::RocksPruningFilter
Rocks pruning filter.
Definition: RocksPruningFilter.h:38
catapult::cache::FilterPruningMode
FilterPruningMode
Possible modes of rocks pruning filter.
Definition: RocksPruningFilter.h:29
RocksPruningFilter.h
catapult::cache::FilterPruningMode::Enabled
Enabled, allocate underlying filter implementation.
catapult::cache::Special_Key_Max_Length
constexpr size_t Special_Key_Max_Length
Definition: RocksInclude.h:30
catapult::cache::RocksPruningFilter::RocksPruningFilterImpl::numRemoved
size_t numRemoved() const
Definition: RocksPruningFilter.cpp:57
catapult::cache::RocksPruningFilter::RocksPruningFilterImpl
Definition: RocksPruningFilter.cpp:26
catapult::cache::RocksPruningFilter::RocksPruningFilterImpl::Name
const char * Name() const override
Definition: RocksPruningFilter.cpp:28
catapult::cache::FilterPruningMode::Disabled
Disabled, skip allocation of underlying filter implementation.
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::cache::RocksPruningFilter::RocksPruningFilter
RocksPruningFilter(FilterPruningMode pruningMode=FilterPruningMode::Disabled)
Creates rocks pruning filter with optional pruningMode.
Definition: RocksPruningFilter.cpp:72
catapult::cache::RocksPruningFilter::RocksPruningFilterImpl::pruningBoundary
uint64_t pruningBoundary() const
Definition: RocksPruningFilter.cpp:53
rocksdb
Definition: RocksDatabase.h:29
catapult::cache::RocksPruningFilter::RocksPruningFilterImpl::m_numRemoved
std::atomic< size_t > m_numRemoved
Definition: RocksPruningFilter.cpp:69
catapult::cache::RocksPruningFilter::RocksPruningFilterImpl::m_compactionBoundary
std::atomic< uint64_t > m_compactionBoundary
Definition: RocksPruningFilter.cpp:68
catapult::cache::RocksPruningFilter::setPruningBoundary
void setPruningBoundary(uint64_t pruningBoundary)
Sets pruning boundary.
Definition: RocksPruningFilter.cpp:91
catapult::cache::RocksPruningFilter::RocksPruningFilterImpl::Filter
bool Filter(int, const rocksdb::Slice &key, const rocksdb::Slice &, std::string *, bool *) const override
Definition: RocksPruningFilter.cpp:33