Coverage Report

Created: 2026-03-15 20:53

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/cloud/cloud_cumulative_compaction.h
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#pragma once
19
20
#include <memory>
21
22
#include "cloud/cloud_storage_engine.h"
23
#include "cloud/cloud_tablet.h"
24
#include "storage/compaction/compaction.h"
25
26
namespace doris {
27
#include "common/compile_check_begin.h"
28
29
class CloudCumulativeCompaction : public CloudCompactionMixin {
30
public:
31
    CloudCumulativeCompaction(CloudStorageEngine& engine, CloudTabletSPtr tablet);
32
33
    ~CloudCumulativeCompaction() override;
34
35
    Status prepare_compact() override;
36
    Status execute_compact() override;
37
    Status request_global_lock();
38
39
    void do_lease();
40
41
0
    int64_t get_input_rowsets_bytes() const { return _input_rowsets_total_size; }
42
0
    int64_t get_input_num_rows() const { return _input_row_num; }
43
44
private:
45
    Status pick_rowsets_to_compact();
46
47
0
    std::string_view compaction_name() const override { return "CloudCumulativeCompaction"; }
48
49
    Status modify_rowsets() override;
50
51
    Status garbage_collection() override;
52
53
    void update_cumulative_point();
54
55
0
    ReaderType compaction_type() const override { return ReaderType::READER_CUMULATIVE_COMPACTION; }
56
57
    int64_t _input_segments = 0;
58
    int64_t _max_conflict_version = 0;
59
    // Snapshot values when pick input rowsets
60
    int64_t _base_compaction_cnt = 0;
61
    int64_t _cumulative_compaction_cnt = 0;
62
    Version _last_delete_version {-1, -1};
63
};
64
65
#include "common/compile_check_end.h"
66
} // namespace doris