YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/rocksdb/memtable/hash_skiplist_rep.h
Line
Count
Source
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
// The following only applies to changes made to this file as part of YugaByte development.
10
//
11
// Portions Copyright (c) YugaByte, Inc.
12
//
13
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
14
// in compliance with the License.  You may obtain a copy of the License at
15
//
16
// http://www.apache.org/licenses/LICENSE-2.0
17
//
18
// Unless required by applicable law or agreed to in writing, software distributed under the License
19
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
20
// or implied.  See the License for the specific language governing permissions and limitations
21
// under the License.
22
//
23
24
#pragma once
25
#ifndef ROCKSDB_LITE
26
#include "yb/rocksdb/slice_transform.h"
27
#include "yb/rocksdb/memtablerep.h"
28
29
namespace rocksdb {
30
31
class HashSkipListRepFactory : public MemTableRepFactory {
32
 public:
33
  explicit HashSkipListRepFactory(
34
    size_t bucket_count,
35
    int32_t skiplist_height,
36
    int32_t skiplist_branching_factor)
37
      : bucket_count_(bucket_count),
38
        skiplist_height_(skiplist_height),
39
107
        skiplist_branching_factor_(skiplist_branching_factor) { }
40
41
107
  virtual ~HashSkipListRepFactory() {}
42
43
  virtual MemTableRep* CreateMemTableRep(
44
      const MemTableRep::KeyComparator& compare, MemTableAllocator* allocator,
45
      const SliceTransform* transform, Logger* logger) override;
46
47
860
  virtual const char* Name() const override {
48
860
    return "HashSkipListRepFactory";
49
860
  }
50
51
 private:
52
  const size_t bucket_count_;
53
  const int32_t skiplist_height_;
54
  const int32_t skiplist_branching_factor_;
55
};
56
57
}
58
#endif  // ROCKSDB_LITE