]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/db/compaction/compaction_state.h
1 // Copyright (c) Meta Platforms, Inc. and affiliates.
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).
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.
13 #include "db/compaction/compaction.h"
14 #include "db/compaction/subcompaction_state.h"
15 #include "db/internal_stats.h"
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
20 namespace ROCKSDB_NAMESPACE
{
22 // Maintains state for the entire compaction
23 class CompactionState
{
25 Compaction
* const compaction
;
27 // REQUIRED: subcompaction states are stored in order of increasing key-range
28 std::vector
<SubcompactionState
> sub_compact_states
;
31 void AggregateCompactionStats(
32 InternalStats::CompactionStatsFull
& compaction_stats
,
33 CompactionJobStats
& compaction_job_stats
);
35 explicit CompactionState(Compaction
* c
) : compaction(c
) {}
37 Slice
SmallestUserKey();
39 Slice
LargestUserKey();
42 } // namespace ROCKSDB_NAMESPACE