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_linklist_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 HashLinkListRepFactory : public MemTableRepFactory {
32
 public:
33
  explicit HashLinkListRepFactory(size_t bucket_count,
34
                                  uint32_t threshold_use_skiplist,
35
                                  size_t huge_page_tlb_size,
36
                                  int bucket_entries_logging_threshold,
37
                                  bool if_log_bucket_dist_when_flash)
38
      : bucket_count_(bucket_count),
39
        threshold_use_skiplist_(threshold_use_skiplist),
40
        huge_page_tlb_size_(huge_page_tlb_size),
41
        bucket_entries_logging_threshold_(bucket_entries_logging_threshold),
42
279
        if_log_bucket_dist_when_flash_(if_log_bucket_dist_when_flash) {}
43
44
279
  virtual ~HashLinkListRepFactory() {}
45
46
  virtual MemTableRep* CreateMemTableRep(
47
      const MemTableRep::KeyComparator& compare, MemTableAllocator* allocator,
48
      const SliceTransform* transform, Logger* logger) override;
49
50
1.33k
  virtual const char* Name() const override {
51
1.33k
    return "HashLinkListRepFactory";
52
1.33k
  }
53
54
 private:
55
  const size_t bucket_count_;
56
  const uint32_t threshold_use_skiplist_;
57
  const size_t huge_page_tlb_size_;
58
  int bucket_entries_logging_threshold_;
59
  bool if_log_bucket_dist_when_flash_;
60
};
61
62
}
63
#endif  // ROCKSDB_LITE