1 // Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
2 //  This source code is licensed under both the GPLv2 (found in the
3 //  COPYING file in the root directory) and Apache 2.0 License
4 //  (found in the LICENSE.Apache file in the root 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_NAMESPACE {
15 
16 class HashSkipListRepFactory : public MemTableRepFactory {
17  public:
HashSkipListRepFactory(size_t bucket_count,int32_t skiplist_height,int32_t skiplist_branching_factor)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 
~HashSkipListRepFactory()26   virtual ~HashSkipListRepFactory() {}
27 
28   using MemTableRepFactory::CreateMemTableRep;
29   virtual MemTableRep* CreateMemTableRep(
30       const MemTableRep::KeyComparator& compare, Allocator* allocator,
31       const SliceTransform* transform, Logger* logger) override;
32 
Name()33   virtual const char* Name() const override {
34     return "HashSkipListRepFactory";
35   }
36 
37  private:
38   const size_t bucket_count_;
39   const int32_t skiplist_height_;
40   const int32_t skiplist_branching_factor_;
41 };
42 
43 }  // namespace ROCKSDB_NAMESPACE
44 #endif  // ROCKSDB_LITE
45