Coverage Report

Created: 2025-10-26 07:13

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/rocksdb/db/compaction/compaction_state.h
Line
Count
Source
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& internal_stats,
33
      CompactionJobStats& job_stats);
34
35
3.68k
  explicit CompactionState(Compaction* c) : compaction(c) {}
36
37
  Slice SmallestUserKey();
38
39
  Slice LargestUserKey();
40
};
41
42
}  // namespace ROCKSDB_NAMESPACE