/src/rocksdb/db/compaction/compaction_picker_fifo.h
Line | Count | Source (jump to first uncovered line) |
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 | | class FIFOCompactionPicker : public CompactionPicker { |
16 | | public: |
17 | | FIFOCompactionPicker(const ImmutableOptions& ioptions, |
18 | | const InternalKeyComparator* icmp) |
19 | 0 | : CompactionPicker(ioptions, icmp) {} |
20 | | |
21 | | Compaction* PickCompaction(const std::string& cf_name, |
22 | | const MutableCFOptions& mutable_cf_options, |
23 | | const MutableDBOptions& mutable_db_options, |
24 | | VersionStorageInfo* version, |
25 | | LogBuffer* log_buffer) override; |
26 | | |
27 | | Compaction* CompactRange(const std::string& cf_name, |
28 | | const MutableCFOptions& mutable_cf_options, |
29 | | const MutableDBOptions& mutable_db_options, |
30 | | VersionStorageInfo* vstorage, int input_level, |
31 | | int output_level, |
32 | | const CompactRangeOptions& compact_range_options, |
33 | | const InternalKey* begin, const InternalKey* end, |
34 | | InternalKey** compaction_end, bool* manual_conflict, |
35 | | uint64_t max_file_num_to_ignore, |
36 | | const std::string& trim_ts) override; |
37 | | |
38 | | // The maximum allowed output level. Always returns 0. |
39 | 0 | int MaxOutputLevel() const override { return 0; } |
40 | | |
41 | | bool NeedsCompaction(const VersionStorageInfo* vstorage) const override; |
42 | | |
43 | | private: |
44 | | Compaction* PickTTLCompaction(const std::string& cf_name, |
45 | | const MutableCFOptions& mutable_cf_options, |
46 | | const MutableDBOptions& mutable_db_options, |
47 | | VersionStorageInfo* version, |
48 | | LogBuffer* log_buffer); |
49 | | |
50 | | Compaction* PickSizeCompaction(const std::string& cf_name, |
51 | | const MutableCFOptions& mutable_cf_options, |
52 | | const MutableDBOptions& mutable_db_options, |
53 | | VersionStorageInfo* version, |
54 | | LogBuffer* log_buffer); |
55 | | |
56 | | Compaction* PickTemperatureChangeCompaction( |
57 | | const std::string& cf_name, const MutableCFOptions& mutable_cf_options, |
58 | | const MutableDBOptions& mutable_db_options, VersionStorageInfo* vstorage, |
59 | | LogBuffer* log_buffer); |
60 | | }; |
61 | | } // namespace ROCKSDB_NAMESPACE |