GCC Code Coverage Report


Directory: src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 81.2% 13 / 0 / 16
Functions: 62.5% 5 / 0 / 8
Branches: 50.0% 1 / 0 / 2

storage/index/dram/extendible_hash_index.h
Line Branch Exec Source
1 #pragma once
2
3 #include <memory>
4
5 #include "base/factory.h"
6 #include "storage/index/dram/extendible_hash.h"
7
8 class DramExtendibleHashIndex : public Index {
9 public:
10 334 explicit DramExtendibleHashIndex(const BaseKVConfig& config)
11
1/2
✓ Branch 2 taken 334 times.
✗ Branch 3 not taken.
334 : Index(config), impl_(std::make_unique<ExtendibleHash>(config)) {}
12
13 40790 void Get(Key_t key, Value_t& pointer, unsigned tid) override {
14 40790 impl_->Get(key, pointer, tid);
15 40790 }
16
17 78692 Value_t Put(Key_t key, Value_t pointer, unsigned tid) override {
18 78692 return impl_->Put(key, pointer, tid);
19 }
20
21 410 void BatchGet(base::ConstArray<Key_t> keys,
22 Value_t* pointers,
23 unsigned tid) override {
24 410 impl_->BatchGet(keys, pointers, tid);
25 410 }
26
27 18 void BatchPut(base::ConstArray<Key_t> keys,
28 Value_t* pointers,
29 unsigned tid) override {
30 18 impl_->BatchPut(keys, pointers, tid);
31 18 }
32
33 bool Delete(Key_t& key) override { return impl_->Delete(key); }
34 double Utilization() override { return impl_->Utilization(); }
35 size_t Capacity() override { return impl_->Capacity(); }
36
37 private:
38 std::unique_ptr<ExtendibleHash> impl_;
39 };
40
41 FACTORY_REGISTER(Index, DRAM, DramExtendibleHashIndex, const BaseKVConfig&);
42 FACTORY_REGISTER(
43 Index, DRAM_EXTENDIBLE_HASH, DramExtendibleHashIndex, const BaseKVConfig&);
44