hash_skiplist_rep.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #pragma once
  9. #ifndef ROCKSDB_LITE
  10. #include "rocksdb/slice_transform.h"
  11. #include "rocksdb/memtablerep.h"
  12. namespace ROCKSDB_NAMESPACE {
  13. class HashSkipListRepFactory : public MemTableRepFactory {
  14. public:
  15. explicit HashSkipListRepFactory(
  16. size_t bucket_count,
  17. int32_t skiplist_height,
  18. int32_t skiplist_branching_factor)
  19. : bucket_count_(bucket_count),
  20. skiplist_height_(skiplist_height),
  21. skiplist_branching_factor_(skiplist_branching_factor) { }
  22. virtual ~HashSkipListRepFactory() {}
  23. using MemTableRepFactory::CreateMemTableRep;
  24. virtual MemTableRep* CreateMemTableRep(
  25. const MemTableRep::KeyComparator& compare, Allocator* allocator,
  26. const SliceTransform* transform, Logger* logger) override;
  27. virtual const char* Name() const override {
  28. return "HashSkipListRepFactory";
  29. }
  30. private:
  31. const size_t bucket_count_;
  32. const int32_t skiplist_height_;
  33. const int32_t skiplist_branching_factor_;
  34. };
  35. } // namespace ROCKSDB_NAMESPACE
  36. #endif // ROCKSDB_LITE