Coverage Report

Created: 2025-11-23 05:07

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/root/doris/be/src/pipeline/shuffle/writer.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 "vec/sink/vdata_stream_sender.h"
21
22
namespace doris {
23
class RuntimeState;
24
class Status;
25
namespace vectorized {
26
class Block;
27
class Channel;
28
} // namespace vectorized
29
namespace pipeline {
30
31
#include "common/compile_check_begin.h"
32
class ExchangeSinkLocalState;
33
34
class Writer {
35
public:
36
7
    Writer() = default;
37
38
    Status write(ExchangeSinkLocalState* local_state, RuntimeState* state, vectorized::Block* block,
39
                 bool eos);
40
41
private:
42
    template <typename ChannelIdType>
43
    Status _channel_add_rows(RuntimeState* state,
44
                             std::vector<std::shared_ptr<vectorized::Channel>>& channels,
45
                             size_t partition_count, const ChannelIdType* __restrict channel_ids,
46
                             size_t rows, vectorized::Block* block, bool eos);
47
48
    template <typename ChannelPtrType>
49
    void _handle_eof_channel(RuntimeState* state, ChannelPtrType channel, Status st) const;
50
51
    vectorized::PaddedPODArray<uint32_t> _row_idx;
52
    vectorized::PaddedPODArray<uint32_t> _partition_rows_histogram;
53
    vectorized::PaddedPODArray<uint32_t> _channel_start_offsets;
54
};
55
#include "common/compile_check_end.h"
56
} // namespace pipeline
57
} // namespace doris