Coverage Report

Created: 2026-03-12 16:03

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exec/pipeline/revokable_task.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
#include <string>
22
23
#include "common/status.h"
24
#include "exec/operator/operator.h"
25
#include "exec/operator/spill_utils.h"
26
#include "exec/pipeline/dependency.h"
27
#include "exec/pipeline/pipeline.h"
28
#include "exec/pipeline/pipeline_task.h"
29
30
namespace doris {
31
class RuntimeState;
32
33
class PipelineFragmentContext;
34
35
class RevokableTask : public PipelineTask {
36
public:
37
    RevokableTask(PipelineTaskSPtr task, std::shared_ptr<SpillContext> spill_context)
38
969
            : _task(std::move(task)), _spill_context(std::move(spill_context)) {}
39
40
969
    ~RevokableTask() override = default;
41
42
0
    RuntimeState* runtime_state() const override { return _task->runtime_state(); }
43
44
0
    Status close(Status exec_status, bool close_sink) override {
45
0
        return _task->close(exec_status, close_sink);
46
0
    }
47
48
0
    Status finalize() override { return _task->finalize(); }
49
50
1.93k
    bool set_running(bool running) override { return _task->set_running(running); }
51
52
969
    bool is_finalized() const override { return _task->is_finalized(); }
53
54
969
    std::weak_ptr<PipelineFragmentContext>& fragment_context() override {
55
969
        return _task->fragment_context();
56
969
    }
57
58
969
    PipelineTask& set_thread_id(int thread_id) override { return _task->set_thread_id(thread_id); }
59
60
0
    PipelineId pipeline_id() const override { return _task->pipeline_id(); }
61
62
0
    std::string task_name() const override { return _task->task_name(); }
63
64
968
    Status execute(bool* done) override { return _task->do_revoke_memory(_spill_context); }
65
66
969
    bool is_blockable() const override { return true; }
67
68
private:
69
    PipelineTaskSPtr _task;
70
    std::shared_ptr<SpillContext> _spill_context;
71
};
72
73
} // namespace doris