/src/rocksdb/db/compaction/compaction_picker_level.h
Line | Count | Source |
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 | | |
10 | | #pragma once |
11 | | |
12 | | #include "db/compaction/compaction_picker.h" |
13 | | |
14 | | namespace ROCKSDB_NAMESPACE { |
15 | | // Picking compactions for leveled compaction. See wiki page |
16 | | // https://github.com/facebook/rocksdb/wiki/Leveled-Compaction |
17 | | // for description of Leveled compaction. |
18 | | class LevelCompactionPicker : public CompactionPicker { |
19 | | public: |
20 | | LevelCompactionPicker(const ImmutableOptions& ioptions, |
21 | | const InternalKeyComparator* icmp) |
22 | 12.0k | : CompactionPicker(ioptions, icmp) {} |
23 | | Compaction* PickCompaction(const std::string& cf_name, |
24 | | const MutableCFOptions& mutable_cf_options, |
25 | | const MutableDBOptions& mutable_db_options, |
26 | | VersionStorageInfo* vstorage, |
27 | | LogBuffer* log_buffer) override; |
28 | | |
29 | | bool NeedsCompaction(const VersionStorageInfo* vstorage) const override; |
30 | | }; |
31 | | |
32 | | } // namespace ROCKSDB_NAMESPACE |