]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/db/compaction/compaction_state.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / db / compaction / compaction_state.h
1 // Copyright (c) Meta Platforms, Inc. and affiliates.
2 //
3 // This source code is licensed under both the GPLv2 (found in the
4 // COPYING file in the root directory) and Apache 2.0 License
5 // (found in the LICENSE.Apache file in the root directory).
6 //
7 // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
8 // Use of this source code is governed by a BSD-style license that can be
9 // found in the LICENSE file. See the AUTHORS file for names of contributors.
10
11 #pragma once
12
13 #include "db/compaction/compaction.h"
14 #include "db/compaction/subcompaction_state.h"
15 #include "db/internal_stats.h"
16
17 // Data structures used for compaction_job and compaction_service_job which has
18 // the list of sub_compact_states and the aggregated information for the
19 // compaction.
20 namespace ROCKSDB_NAMESPACE {
21
22 // Maintains state for the entire compaction
23 class CompactionState {
24 public:
25 Compaction* const compaction;
26
27 // REQUIRED: subcompaction states are stored in order of increasing key-range
28 std::vector<SubcompactionState> sub_compact_states;
29 Status status;
30
31 void AggregateCompactionStats(
32 InternalStats::CompactionStatsFull& compaction_stats,
33 CompactionJobStats& compaction_job_stats);
34
35 explicit CompactionState(Compaction* c) : compaction(c) {}
36
37 Slice SmallestUserKey();
38
39 Slice LargestUserKey();
40 };
41
42 } // namespace ROCKSDB_NAMESPACE