]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Copyright (c) 2011-present, Facebook, Inc. All rights reserved. |
2 | // This source code is licensed under the BSD-style license found in the | |
3 | // LICENSE file in the root directory of this source tree. An additional grant | |
4 | // of patent rights can be found in the PATENTS file in the same directory. | |
5 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. | |
6 | // Use of this source code is governed by a BSD-style license that can be | |
7 | // found in the LICENSE file. See the AUTHORS file for names of contributors. | |
8 | ||
9 | #pragma once | |
10 | #ifndef ROCKSDB_LITE | |
11 | #include "rocksdb/slice_transform.h" | |
12 | #include "rocksdb/memtablerep.h" | |
13 | ||
14 | namespace rocksdb { | |
15 | ||
16 | class HashSkipListRepFactory : public MemTableRepFactory { | |
17 | public: | |
18 | explicit HashSkipListRepFactory( | |
19 | size_t bucket_count, | |
20 | int32_t skiplist_height, | |
21 | int32_t skiplist_branching_factor) | |
22 | : bucket_count_(bucket_count), | |
23 | skiplist_height_(skiplist_height), | |
24 | skiplist_branching_factor_(skiplist_branching_factor) { } | |
25 | ||
26 | virtual ~HashSkipListRepFactory() {} | |
27 | ||
28 | virtual MemTableRep* CreateMemTableRep( | |
29 | const MemTableRep::KeyComparator& compare, MemTableAllocator* allocator, | |
30 | const SliceTransform* transform, Logger* logger) override; | |
31 | ||
32 | virtual const char* Name() const override { | |
33 | return "HashSkipListRepFactory"; | |
34 | } | |
35 | ||
36 | private: | |
37 | const size_t bucket_count_; | |
38 | const int32_t skiplist_height_; | |
39 | const int32_t skiplist_branching_factor_; | |
40 | }; | |
41 | ||
42 | } | |
43 | #endif // ROCKSDB_LITE |