compaction_picker_level.h 1.3 KB

1234567891011121314151617181920212223242526272829303132
  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. //
  6. // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
  7. // Use of this source code is governed by a BSD-style license that can be
  8. // found in the LICENSE file. See the AUTHORS file for names of contributors.
  9. #pragma once
  10. #include "db/compaction/compaction_picker.h"
  11. namespace ROCKSDB_NAMESPACE {
  12. // Picking compactions for leveled compaction. See wiki page
  13. // https://github.com/facebook/rocksdb/wiki/Leveled-Compaction
  14. // for description of Leveled compaction.
  15. class LevelCompactionPicker : public CompactionPicker {
  16. public:
  17. LevelCompactionPicker(const ImmutableCFOptions& ioptions,
  18. const InternalKeyComparator* icmp)
  19. : CompactionPicker(ioptions, icmp) {}
  20. virtual Compaction* PickCompaction(
  21. const std::string& cf_name, const MutableCFOptions& mutable_cf_options,
  22. VersionStorageInfo* vstorage, LogBuffer* log_buffer,
  23. SequenceNumber earliest_memtable_seqno = kMaxSequenceNumber) override;
  24. virtual bool NeedsCompaction(
  25. const VersionStorageInfo* vstorage) const override;
  26. };
  27. } // namespace ROCKSDB_NAMESPACE