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

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 356 explicit DramExtendibleHashIndex(const BaseKVConfig& config)
11
1/2
✓ Branch 2 taken 356 times.
✗ Branch 3 not taken.
356 : Index(config), impl_(std::make_unique<ExtendibleHash>(config)) {}
12
13 40644 void Get(Key_t key, Value_t& pointer, unsigned tid) override {
14 40644 impl_->Get(key, pointer, tid);
15 40644 }
16
17 79030 Value_t Put(Key_t key, Value_t pointer, unsigned tid) override {
18 79030 return impl_->Put(key, pointer, tid);
19 }
20
21 448 void BatchGet(base::ConstArray<Key_t> keys,
22 Value_t* pointers,
23 unsigned tid) override {
24 448 impl_->BatchGet(keys, pointers, tid);
25 448 }
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