be/src/storage/segment/binary_plain_page.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 | | // Simplistic page encoding for strings. |
19 | | // |
20 | | // The page consists of: |
21 | | // Strings: |
22 | | // raw strings that were written |
23 | | // Trailer |
24 | | // Offsets: |
25 | | // offsets pointing to the beginning of each string |
26 | | // num_elems (32-bit fixed) |
27 | | // |
28 | | |
29 | | #pragma once |
30 | | |
31 | | #include "common/logging.h" |
32 | | #include "core/column/column_complex.h" |
33 | | #include "core/column/column_nullable.h" |
34 | | #include "storage/olap_common.h" |
35 | | #include "storage/segment/options.h" |
36 | | #include "storage/segment/page_builder.h" |
37 | | #include "storage/segment/page_decoder.h" |
38 | | #include "storage/types.h" |
39 | | #include "util/coding.h" |
40 | | #include "util/faststring.h" |
41 | | |
42 | | namespace doris { |
43 | | namespace segment_v2 { |
44 | | #include "common/compile_check_begin.h" |
45 | | |
46 | | template <FieldType Type> |
47 | | class BinaryPlainPageBuilder : public PageBuilderHelper<BinaryPlainPageBuilder<Type>> { |
48 | | public: |
49 | | using Self = BinaryPlainPageBuilder<Type>; |
50 | | friend class PageBuilderHelper<Self>; |
51 | | |
52 | 21.3k | Status init() override { return reset(); }Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE4initEv _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE4initEv Line | Count | Source | 52 | 5.53k | Status init() override { return reset(); } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE4initEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE4initEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE4initEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE4initEv _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE4initEv Line | Count | Source | 52 | 15.7k | Status init() override { return reset(); } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE4initEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE4initEv |
53 | | |
54 | 1.52M | bool is_page_full() override { |
55 | 1.52M | bool ret = false; |
56 | 1.52M | if (_options.is_dict_page) { |
57 | | // dict_page_size is 0, do not limit the page size |
58 | 1.11M | ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size; |
59 | 1.11M | } else { |
60 | 407k | ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size; |
61 | 407k | } |
62 | 1.52M | return ret; |
63 | 1.52M | } Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE12is_page_fullEv _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE12is_page_fullEv Line | Count | Source | 54 | 1.46M | bool is_page_full() override { | 55 | 1.46M | bool ret = false; | 56 | 1.46M | if (_options.is_dict_page) { | 57 | | // dict_page_size is 0, do not limit the page size | 58 | 1.11M | ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size; | 59 | 1.11M | } else { | 60 | 347k | ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size; | 61 | 347k | } | 62 | 1.46M | return ret; | 63 | 1.46M | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE12is_page_fullEv _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE12is_page_fullEv Line | Count | Source | 54 | 59.4k | bool is_page_full() override { | 55 | 59.4k | bool ret = false; | 56 | 59.4k | if (_options.is_dict_page) { | 57 | | // dict_page_size is 0, do not limit the page size | 58 | 0 | ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size; | 59 | 59.4k | } else { | 60 | 59.4k | ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size; | 61 | 59.4k | } | 62 | 59.4k | return ret; | 63 | 59.4k | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE12is_page_fullEv |
64 | | |
65 | 250k | Status add(const uint8_t* vals, size_t* count) override { |
66 | 250k | DCHECK(!_finished); |
67 | 250k | DCHECK_GT(*count, 0); |
68 | 250k | size_t i = 0; |
69 | | |
70 | | // If the page is full, should stop adding more items. |
71 | 537k | while (!is_page_full() && i < *count) { |
72 | 287k | const auto* src = reinterpret_cast<const Slice*>(vals); |
73 | 287k | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { |
74 | 19.8k | if (_options.need_check_bitmap) { |
75 | 0 | RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data))); |
76 | 0 | } |
77 | 19.8k | } |
78 | 19.8k | size_t offset = _buffer.size(); |
79 | 287k | _offsets.push_back(cast_set<uint32_t>(offset)); |
80 | | // This may need a large memory, should return error if could not allocated |
81 | | // successfully, to avoid BE OOM. |
82 | 287k | RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size)); |
83 | | |
84 | 287k | _last_value_size = cast_set<uint32_t>(src->size); |
85 | 287k | _size_estimate += src->size; |
86 | 287k | _size_estimate += sizeof(uint32_t); |
87 | 287k | _raw_data_size += src->size; |
88 | | |
89 | 287k | i++; |
90 | 287k | vals += sizeof(Slice); |
91 | 287k | } |
92 | | |
93 | 250k | *count = i; |
94 | 250k | return Status::OK(); |
95 | 250k | } Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE3addEPKhPm _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE3addEPKhPm Line | Count | Source | 65 | 230k | Status add(const uint8_t* vals, size_t* count) override { | 66 | 230k | DCHECK(!_finished); | 67 | 230k | DCHECK_GT(*count, 0); | 68 | 230k | size_t i = 0; | 69 | | | 70 | | // If the page is full, should stop adding more items. | 71 | 497k | while (!is_page_full() && i < *count) { | 72 | 267k | const auto* src = reinterpret_cast<const Slice*>(vals); | 73 | | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 74 | | if (_options.need_check_bitmap) { | 75 | | RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data))); | 76 | | } | 77 | | } | 78 | 267k | size_t offset = _buffer.size(); | 79 | 267k | _offsets.push_back(cast_set<uint32_t>(offset)); | 80 | | // This may need a large memory, should return error if could not allocated | 81 | | // successfully, to avoid BE OOM. | 82 | 267k | RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size)); | 83 | | | 84 | 267k | _last_value_size = cast_set<uint32_t>(src->size); | 85 | 267k | _size_estimate += src->size; | 86 | 267k | _size_estimate += sizeof(uint32_t); | 87 | 267k | _raw_data_size += src->size; | 88 | | | 89 | 267k | i++; | 90 | 267k | vals += sizeof(Slice); | 91 | 267k | } | 92 | | | 93 | 230k | *count = i; | 94 | 230k | return Status::OK(); | 95 | 230k | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE3addEPKhPm _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE3addEPKhPm Line | Count | Source | 65 | 19.8k | Status add(const uint8_t* vals, size_t* count) override { | 66 | 19.8k | DCHECK(!_finished); | 67 | 19.8k | DCHECK_GT(*count, 0); | 68 | 19.8k | size_t i = 0; | 69 | | | 70 | | // If the page is full, should stop adding more items. | 71 | 39.6k | while (!is_page_full() && i < *count) { | 72 | 19.8k | const auto* src = reinterpret_cast<const Slice*>(vals); | 73 | 19.8k | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 74 | 19.8k | if (_options.need_check_bitmap) { | 75 | 0 | RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data))); | 76 | 0 | } | 77 | 19.8k | } | 78 | 19.8k | size_t offset = _buffer.size(); | 79 | 19.8k | _offsets.push_back(cast_set<uint32_t>(offset)); | 80 | | // This may need a large memory, should return error if could not allocated | 81 | | // successfully, to avoid BE OOM. | 82 | 19.8k | RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size)); | 83 | | | 84 | 19.8k | _last_value_size = cast_set<uint32_t>(src->size); | 85 | 19.8k | _size_estimate += src->size; | 86 | 19.8k | _size_estimate += sizeof(uint32_t); | 87 | 19.8k | _raw_data_size += src->size; | 88 | | | 89 | 19.8k | i++; | 90 | 19.8k | vals += sizeof(Slice); | 91 | 19.8k | } | 92 | | | 93 | 19.8k | *count = i; | 94 | 19.8k | return Status::OK(); | 95 | 19.8k | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE3addEPKhPm |
96 | | |
97 | 23.2k | Status finish(OwnedSlice* slice) override { |
98 | 23.2k | DCHECK(!_finished); |
99 | 23.2k | _finished = true; |
100 | 23.2k | RETURN_IF_CATCH_EXCEPTION({ |
101 | | // Set up trailer |
102 | 23.2k | for (uint32_t _offset : _offsets) { |
103 | 23.2k | put_fixed32_le(&_buffer, _offset); |
104 | 23.2k | } |
105 | 23.2k | put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size())); |
106 | 23.2k | if (_offsets.size() > 0) { |
107 | 23.2k | _copy_value_at(0, &_first_value); |
108 | 23.2k | _copy_value_at(_offsets.size() - 1, &_last_value); |
109 | 23.2k | } |
110 | 23.2k | *slice = _buffer.build(); |
111 | 23.2k | }); |
112 | 23.2k | return Status::OK(); |
113 | 23.2k | } Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE6finishEPNS_10OwnedSliceE _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE6finishEPNS_10OwnedSliceE Line | Count | Source | 97 | 7.45k | Status finish(OwnedSlice* slice) override { | 98 | 7.45k | DCHECK(!_finished); | 99 | 7.45k | _finished = true; | 100 | 7.45k | RETURN_IF_CATCH_EXCEPTION({ | 101 | | // Set up trailer | 102 | 7.45k | for (uint32_t _offset : _offsets) { | 103 | 7.45k | put_fixed32_le(&_buffer, _offset); | 104 | 7.45k | } | 105 | 7.45k | put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size())); | 106 | 7.45k | if (_offsets.size() > 0) { | 107 | 7.45k | _copy_value_at(0, &_first_value); | 108 | 7.45k | _copy_value_at(_offsets.size() - 1, &_last_value); | 109 | 7.45k | } | 110 | 7.45k | *slice = _buffer.build(); | 111 | 7.45k | }); | 112 | 7.45k | return Status::OK(); | 113 | 7.45k | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE6finishEPNS_10OwnedSliceE _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE6finishEPNS_10OwnedSliceE Line | Count | Source | 97 | 15.7k | Status finish(OwnedSlice* slice) override { | 98 | 15.7k | DCHECK(!_finished); | 99 | 15.7k | _finished = true; | 100 | 15.7k | RETURN_IF_CATCH_EXCEPTION({ | 101 | | // Set up trailer | 102 | 15.7k | for (uint32_t _offset : _offsets) { | 103 | 15.7k | put_fixed32_le(&_buffer, _offset); | 104 | 15.7k | } | 105 | 15.7k | put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size())); | 106 | 15.7k | if (_offsets.size() > 0) { | 107 | 15.7k | _copy_value_at(0, &_first_value); | 108 | 15.7k | _copy_value_at(_offsets.size() - 1, &_last_value); | 109 | 15.7k | } | 110 | 15.7k | *slice = _buffer.build(); | 111 | 15.7k | }); | 112 | 15.7k | return Status::OK(); | 113 | 15.7k | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE6finishEPNS_10OwnedSliceE |
114 | | |
115 | 40.6k | Status reset() override { |
116 | 40.6k | RETURN_IF_CATCH_EXCEPTION({ |
117 | 40.6k | _offsets.clear(); |
118 | 40.6k | _buffer.clear(); |
119 | 40.6k | _buffer.reserve(_options.data_page_size == 0 |
120 | 40.6k | ? 1024 |
121 | 40.6k | : std::min(_options.data_page_size, _options.dict_page_size)); |
122 | 40.6k | _size_estimate = sizeof(uint32_t); |
123 | 40.6k | _finished = false; |
124 | 40.6k | _last_value_size = 0; |
125 | 40.6k | _raw_data_size = 0; |
126 | 40.6k | }); |
127 | 40.6k | return Status::OK(); |
128 | 40.6k | } Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE5resetEv _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE5resetEv Line | Count | Source | 115 | 9.16k | Status reset() override { | 116 | 9.16k | RETURN_IF_CATCH_EXCEPTION({ | 117 | 9.16k | _offsets.clear(); | 118 | 9.16k | _buffer.clear(); | 119 | 9.16k | _buffer.reserve(_options.data_page_size == 0 | 120 | 9.16k | ? 1024 | 121 | 9.16k | : std::min(_options.data_page_size, _options.dict_page_size)); | 122 | 9.16k | _size_estimate = sizeof(uint32_t); | 123 | 9.16k | _finished = false; | 124 | 9.16k | _last_value_size = 0; | 125 | 9.16k | _raw_data_size = 0; | 126 | 9.16k | }); | 127 | 9.16k | return Status::OK(); | 128 | 9.16k | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE5resetEv _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE5resetEv Line | Count | Source | 115 | 31.5k | Status reset() override { | 116 | 31.5k | RETURN_IF_CATCH_EXCEPTION({ | 117 | 31.5k | _offsets.clear(); | 118 | 31.5k | _buffer.clear(); | 119 | 31.5k | _buffer.reserve(_options.data_page_size == 0 | 120 | 31.5k | ? 1024 | 121 | 31.5k | : std::min(_options.data_page_size, _options.dict_page_size)); | 122 | 31.5k | _size_estimate = sizeof(uint32_t); | 123 | 31.5k | _finished = false; | 124 | 31.5k | _last_value_size = 0; | 125 | 31.5k | _raw_data_size = 0; | 126 | 31.5k | }); | 127 | 31.5k | return Status::OK(); | 128 | 31.5k | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE5resetEv |
129 | | |
130 | 15.8k | size_t count() const override { return _offsets.size(); }Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE5countEv _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE5countEv Line | Count | Source | 130 | 118 | size_t count() const override { return _offsets.size(); } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE5countEv _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE5countEv Line | Count | Source | 130 | 15.7k | size_t count() const override { return _offsets.size(); } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE5countEv |
131 | | |
132 | 1.02k | uint64_t size() const override { return _size_estimate; }Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE4sizeEv _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE4sizeEv Line | Count | Source | 132 | 1.02k | uint64_t size() const override { return _size_estimate; } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE4sizeEv |
133 | | |
134 | 0 | uint64_t get_raw_data_size() const override { return _raw_data_size; }Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE17get_raw_data_sizeEv |
135 | | |
136 | 0 | Status get_first_value(void* value) const override { |
137 | 0 | DCHECK(_finished); |
138 | 0 | if (_offsets.size() == 0) { |
139 | 0 | return Status::Error<ErrorCode::ENTRY_NOT_FOUND>("page is empty"); |
140 | 0 | } |
141 | 0 | *reinterpret_cast<Slice*>(value) = Slice(_first_value); |
142 | 0 | return Status::OK(); |
143 | 0 | } Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE15get_first_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE15get_first_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE15get_first_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE15get_first_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE15get_first_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE15get_first_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE15get_first_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE15get_first_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE15get_first_valueEPv |
144 | 0 | Status get_last_value(void* value) const override { |
145 | 0 | DCHECK(_finished); |
146 | 0 | if (_offsets.size() == 0) { |
147 | 0 | return Status::Error<ErrorCode::ENTRY_NOT_FOUND>("page is empty"); |
148 | 0 | } |
149 | 0 | *reinterpret_cast<Slice*>(value) = Slice(_last_value); |
150 | 0 | return Status::OK(); |
151 | 0 | } Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE14get_last_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE14get_last_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE14get_last_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE14get_last_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE14get_last_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE14get_last_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE14get_last_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE14get_last_valueEPv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE14get_last_valueEPv |
152 | | |
153 | 2 | inline Slice operator[](size_t idx) const { |
154 | 2 | DCHECK(!_finished); |
155 | 2 | DCHECK_LT(idx, _offsets.size()); |
156 | 2 | size_t value_size = |
157 | 2 | (idx < _offsets.size() - 1) ? _offsets[idx + 1] - _offsets[idx] : _last_value_size; |
158 | 2 | return Slice(&_buffer[_offsets[idx]], value_size); |
159 | 2 | } Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EEixEm _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EEixEm Line | Count | Source | 153 | 2 | inline Slice operator[](size_t idx) const { | 154 | 2 | DCHECK(!_finished); | 155 | 2 | DCHECK_LT(idx, _offsets.size()); | 156 | 2 | size_t value_size = | 157 | 2 | (idx < _offsets.size() - 1) ? _offsets[idx + 1] - _offsets[idx] : _last_value_size; | 158 | 2 | return Slice(&_buffer[_offsets[idx]], value_size); | 159 | 2 | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EEixEm Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EEixEm Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EEixEm Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EEixEm Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EEixEm Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EEixEm Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EEixEm |
160 | | |
161 | 2 | Status get_dict_word(uint32_t value_code, Slice* word) override { |
162 | 2 | *word = (*this)[value_code]; |
163 | 2 | return Status::OK(); |
164 | 2 | } Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE13get_dict_wordEjPNS_5SliceE _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE13get_dict_wordEjPNS_5SliceE Line | Count | Source | 161 | 2 | Status get_dict_word(uint32_t value_code, Slice* word) override { | 162 | 2 | *word = (*this)[value_code]; | 163 | 2 | return Status::OK(); | 164 | 2 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE13get_dict_wordEjPNS_5SliceE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE13get_dict_wordEjPNS_5SliceE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE13get_dict_wordEjPNS_5SliceE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE13get_dict_wordEjPNS_5SliceE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE13get_dict_wordEjPNS_5SliceE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE13get_dict_wordEjPNS_5SliceE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE13get_dict_wordEjPNS_5SliceE |
165 | | |
166 | | private: |
167 | | BinaryPlainPageBuilder(const PageBuilderOptions& options) |
168 | 21.3k | : _size_estimate(0), _options(options) {}Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EEC2ERKNS0_18PageBuilderOptionsE _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 168 | 5.53k | : _size_estimate(0), _options(options) {} |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EEC2ERKNS0_18PageBuilderOptionsE _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 168 | 15.7k | : _size_estimate(0), _options(options) {} |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EEC2ERKNS0_18PageBuilderOptionsE |
169 | | |
170 | 46.3k | void _copy_value_at(size_t idx, faststring* value) const { |
171 | 46.3k | size_t value_size = |
172 | 46.3k | (idx < _offsets.size() - 1) ? _offsets[idx + 1] - _offsets[idx] : _last_value_size; |
173 | 46.3k | value->assign_copy(&_buffer[_offsets[idx]], value_size); |
174 | 46.3k | } Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE14_copy_value_atEmPNS_10faststringE _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE14_copy_value_atEmPNS_10faststringE Line | Count | Source | 170 | 14.8k | void _copy_value_at(size_t idx, faststring* value) const { | 171 | 14.8k | size_t value_size = | 172 | 14.8k | (idx < _offsets.size() - 1) ? _offsets[idx + 1] - _offsets[idx] : _last_value_size; | 173 | 14.8k | value->assign_copy(&_buffer[_offsets[idx]], value_size); | 174 | 14.8k | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE14_copy_value_atEmPNS_10faststringE Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE14_copy_value_atEmPNS_10faststringE Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE14_copy_value_atEmPNS_10faststringE Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE14_copy_value_atEmPNS_10faststringE _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE14_copy_value_atEmPNS_10faststringE Line | Count | Source | 170 | 31.5k | void _copy_value_at(size_t idx, faststring* value) const { | 171 | 31.5k | size_t value_size = | 172 | 31.5k | (idx < _offsets.size() - 1) ? _offsets[idx + 1] - _offsets[idx] : _last_value_size; | 173 | 31.5k | value->assign_copy(&_buffer[_offsets[idx]], value_size); | 174 | 31.5k | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE14_copy_value_atEmPNS_10faststringE Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE14_copy_value_atEmPNS_10faststringE |
175 | | |
176 | | faststring _buffer; |
177 | | size_t _size_estimate; |
178 | | // Offsets of each entry, relative to the start of the page |
179 | | std::vector<uint32_t> _offsets; |
180 | | bool _finished; |
181 | | PageBuilderOptions _options; |
182 | | // size of last added value |
183 | | uint32_t _last_value_size = 0; |
184 | | uint64_t _raw_data_size = 0; |
185 | | faststring _first_value; |
186 | | faststring _last_value; |
187 | | }; |
188 | | |
189 | | template <FieldType Type> |
190 | | class BinaryPlainPageDecoder : public PageDecoder { |
191 | | public: |
192 | | BinaryPlainPageDecoder(Slice data) : BinaryPlainPageDecoder(data, PageDecoderOptions()) {} |
193 | | |
194 | | BinaryPlainPageDecoder(Slice data, const PageDecoderOptions& options) |
195 | 4.76k | : _data(data), |
196 | 4.76k | _options(options), |
197 | 4.76k | _parsed(false), |
198 | 4.76k | _num_elems(0), |
199 | 4.76k | _offsets_pos(0), |
200 | 4.76k | _cur_idx(0) {}_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 195 | 4.74k | : _data(data), | 196 | 4.74k | _options(options), | 197 | 4.74k | _parsed(false), | 198 | 4.74k | _num_elems(0), | 199 | 4.74k | _offsets_pos(0), | 200 | 4.74k | _cur_idx(0) {} |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 195 | 4 | : _data(data), | 196 | 4 | _options(options), | 197 | 4 | _parsed(false), | 198 | 4 | _num_elems(0), | 199 | 4 | _offsets_pos(0), | 200 | 4 | _cur_idx(0) {} |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 195 | 1 | : _data(data), | 196 | 1 | _options(options), | 197 | 1 | _parsed(false), | 198 | 1 | _num_elems(0), | 199 | 1 | _offsets_pos(0), | 200 | 1 | _cur_idx(0) {} |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 195 | 21 | : _data(data), | 196 | 21 | _options(options), | 197 | 21 | _parsed(false), | 198 | 21 | _num_elems(0), | 199 | 21 | _offsets_pos(0), | 200 | 21 | _cur_idx(0) {} |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE |
201 | | |
202 | 4.76k | Status init() override { |
203 | 4.76k | CHECK(!_parsed); |
204 | | |
205 | 4.76k | if (_data.size < sizeof(uint32_t)) { |
206 | 0 | return Status::Corruption( |
207 | 0 | "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ." |
208 | 0 | "invalid data size:{}, trailer size:{}", |
209 | 0 | _data.size, sizeof(uint32_t)); |
210 | 0 | } |
211 | | |
212 | | // Decode trailer |
213 | 4.76k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); |
214 | 4.76k | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); |
215 | | |
216 | 4.76k | if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) { |
217 | 0 | return Status::Corruption( |
218 | 0 | "file corruption: offsets pos beyonds data_size: {}, num_element: {}" |
219 | 0 | ", offset_pos: {}", |
220 | 0 | _data.size, _num_elems, _offsets_pos); |
221 | 0 | } |
222 | 4.76k | _parsed = true; |
223 | | |
224 | 4.76k | return Status::OK(); |
225 | 4.76k | } _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE4initEv Line | Count | Source | 202 | 4.74k | Status init() override { | 203 | 4.74k | CHECK(!_parsed); | 204 | | | 205 | 4.74k | if (_data.size < sizeof(uint32_t)) { | 206 | 0 | return Status::Corruption( | 207 | 0 | "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ." | 208 | 0 | "invalid data size:{}, trailer size:{}", | 209 | 0 | _data.size, sizeof(uint32_t)); | 210 | 0 | } | 211 | | | 212 | | // Decode trailer | 213 | 4.74k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 214 | 4.74k | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 215 | | | 216 | 4.74k | if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) { | 217 | 0 | return Status::Corruption( | 218 | 0 | "file corruption: offsets pos beyonds data_size: {}, num_element: {}" | 219 | 0 | ", offset_pos: {}", | 220 | 0 | _data.size, _num_elems, _offsets_pos); | 221 | 0 | } | 222 | 4.74k | _parsed = true; | 223 | | | 224 | 4.74k | return Status::OK(); | 225 | 4.74k | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE4initEv Line | Count | Source | 202 | 4 | Status init() override { | 203 | 4 | CHECK(!_parsed); | 204 | | | 205 | 4 | if (_data.size < sizeof(uint32_t)) { | 206 | 0 | return Status::Corruption( | 207 | 0 | "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ." | 208 | 0 | "invalid data size:{}, trailer size:{}", | 209 | 0 | _data.size, sizeof(uint32_t)); | 210 | 0 | } | 211 | | | 212 | | // Decode trailer | 213 | 4 | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 214 | 4 | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 215 | | | 216 | 4 | if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) { | 217 | 0 | return Status::Corruption( | 218 | 0 | "file corruption: offsets pos beyonds data_size: {}, num_element: {}" | 219 | 0 | ", offset_pos: {}", | 220 | 0 | _data.size, _num_elems, _offsets_pos); | 221 | 0 | } | 222 | 4 | _parsed = true; | 223 | | | 224 | 4 | return Status::OK(); | 225 | 4 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE4initEv Line | Count | Source | 202 | 1 | Status init() override { | 203 | 1 | CHECK(!_parsed); | 204 | | | 205 | 1 | if (_data.size < sizeof(uint32_t)) { | 206 | 0 | return Status::Corruption( | 207 | 0 | "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ." | 208 | 0 | "invalid data size:{}, trailer size:{}", | 209 | 0 | _data.size, sizeof(uint32_t)); | 210 | 0 | } | 211 | | | 212 | | // Decode trailer | 213 | 1 | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 214 | 1 | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 215 | | | 216 | 1 | if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) { | 217 | 0 | return Status::Corruption( | 218 | 0 | "file corruption: offsets pos beyonds data_size: {}, num_element: {}" | 219 | 0 | ", offset_pos: {}", | 220 | 0 | _data.size, _num_elems, _offsets_pos); | 221 | 0 | } | 222 | 1 | _parsed = true; | 223 | | | 224 | 1 | return Status::OK(); | 225 | 1 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE4initEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE4initEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE4initEv _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE4initEv Line | Count | Source | 202 | 21 | Status init() override { | 203 | 21 | CHECK(!_parsed); | 204 | | | 205 | 21 | if (_data.size < sizeof(uint32_t)) { | 206 | 0 | return Status::Corruption( | 207 | 0 | "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ." | 208 | 0 | "invalid data size:{}, trailer size:{}", | 209 | 0 | _data.size, sizeof(uint32_t)); | 210 | 0 | } | 211 | | | 212 | | // Decode trailer | 213 | 21 | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 214 | 21 | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 215 | | | 216 | 21 | if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) { | 217 | 0 | return Status::Corruption( | 218 | 0 | "file corruption: offsets pos beyonds data_size: {}, num_element: {}" | 219 | 0 | ", offset_pos: {}", | 220 | 0 | _data.size, _num_elems, _offsets_pos); | 221 | 0 | } | 222 | 21 | _parsed = true; | 223 | | | 224 | 21 | return Status::OK(); | 225 | 21 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE4initEv Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE4initEv |
226 | | |
227 | 238 | Status seek_to_position_in_page(size_t pos) override { |
228 | 238 | if (_num_elems == 0) [[unlikely]] { |
229 | 0 | if (pos != 0) { |
230 | 0 | return Status::Error<ErrorCode::INTERNAL_ERROR, false>( |
231 | 0 | "seek pos {} is larger than total elements {}", pos, _num_elems); |
232 | 0 | } |
233 | 0 | } |
234 | 238 | DCHECK_LE(pos, _num_elems); |
235 | 238 | _cur_idx = pos; |
236 | 238 | return Status::OK(); |
237 | 238 | } _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE24seek_to_position_in_pageEm Line | Count | Source | 227 | 191 | Status seek_to_position_in_page(size_t pos) override { | 228 | 191 | if (_num_elems == 0) [[unlikely]] { | 229 | 0 | if (pos != 0) { | 230 | 0 | return Status::Error<ErrorCode::INTERNAL_ERROR, false>( | 231 | 0 | "seek pos {} is larger than total elements {}", pos, _num_elems); | 232 | 0 | } | 233 | 0 | } | 234 | 191 | DCHECK_LE(pos, _num_elems); | 235 | 191 | _cur_idx = pos; | 236 | 191 | return Status::OK(); | 237 | 191 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE24seek_to_position_in_pageEm Line | Count | Source | 227 | 4 | Status seek_to_position_in_page(size_t pos) override { | 228 | 4 | if (_num_elems == 0) [[unlikely]] { | 229 | 0 | if (pos != 0) { | 230 | 0 | return Status::Error<ErrorCode::INTERNAL_ERROR, false>( | 231 | 0 | "seek pos {} is larger than total elements {}", pos, _num_elems); | 232 | 0 | } | 233 | 0 | } | 234 | 4 | DCHECK_LE(pos, _num_elems); | 235 | 4 | _cur_idx = pos; | 236 | 4 | return Status::OK(); | 237 | 4 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE24seek_to_position_in_pageEm _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE24seek_to_position_in_pageEm Line | Count | Source | 227 | 43 | Status seek_to_position_in_page(size_t pos) override { | 228 | 43 | if (_num_elems == 0) [[unlikely]] { | 229 | 0 | if (pos != 0) { | 230 | 0 | return Status::Error<ErrorCode::INTERNAL_ERROR, false>( | 231 | 0 | "seek pos {} is larger than total elements {}", pos, _num_elems); | 232 | 0 | } | 233 | 0 | } | 234 | 43 | DCHECK_LE(pos, _num_elems); | 235 | 43 | _cur_idx = pos; | 236 | 43 | return Status::OK(); | 237 | 43 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE24seek_to_position_in_pageEm |
238 | | |
239 | 1.56k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { |
240 | 1.56k | DCHECK(_parsed); |
241 | 1.56k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { |
242 | 2 | *n = 0; |
243 | 2 | return Status::OK(); |
244 | 2 | } |
245 | 1.56k | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); |
246 | | |
247 | 1.56k | uint32_t last_offset = guarded_offset(_cur_idx); |
248 | 1.56k | _offsets.resize(max_fetch + 1); |
249 | 1.56k | _offsets[0] = last_offset; |
250 | 305k | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { |
251 | 303k | const uint32_t start_offset = last_offset; |
252 | 303k | last_offset = guarded_offset(_cur_idx + 1); |
253 | 303k | _offsets[i + 1] = last_offset; |
254 | 303k | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { |
255 | 0 | if (_options.need_check_bitmap) { |
256 | 0 | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset))); |
257 | 0 | } |
258 | 0 | } |
259 | 303k | } |
260 | 1.56k | _cur_idx++; |
261 | 1.56k | _offsets[max_fetch] = offset(_cur_idx); |
262 | 1.56k | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { |
263 | 43 | if (_options.need_check_bitmap) { |
264 | 0 | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset))); |
265 | 0 | } |
266 | 43 | } |
267 | 43 | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); |
268 | | |
269 | 1.56k | *n = max_fetch; |
270 | 1.56k | return Status::OK(); |
271 | 1.56k | } _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 239 | 1.51k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 240 | 1.51k | DCHECK(_parsed); | 241 | 1.51k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 242 | 1 | *n = 0; | 243 | 1 | return Status::OK(); | 244 | 1 | } | 245 | 1.51k | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 246 | | | 247 | 1.51k | uint32_t last_offset = guarded_offset(_cur_idx); | 248 | 1.51k | _offsets.resize(max_fetch + 1); | 249 | 1.51k | _offsets[0] = last_offset; | 250 | 305k | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { | 251 | 303k | const uint32_t start_offset = last_offset; | 252 | 303k | last_offset = guarded_offset(_cur_idx + 1); | 253 | 303k | _offsets[i + 1] = last_offset; | 254 | | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 255 | | if (_options.need_check_bitmap) { | 256 | | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset))); | 257 | | } | 258 | | } | 259 | 303k | } | 260 | 1.51k | _cur_idx++; | 261 | 1.51k | _offsets[max_fetch] = offset(_cur_idx); | 262 | | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 263 | | if (_options.need_check_bitmap) { | 264 | | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset))); | 265 | | } | 266 | | } | 267 | 1.51k | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); | 268 | | | 269 | 1.51k | *n = max_fetch; | 270 | 1.51k | return Status::OK(); | 271 | 1.51k | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 239 | 6 | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 240 | 6 | DCHECK(_parsed); | 241 | 6 | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 242 | 1 | *n = 0; | 243 | 1 | return Status::OK(); | 244 | 1 | } | 245 | 5 | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 246 | | | 247 | 5 | uint32_t last_offset = guarded_offset(_cur_idx); | 248 | 5 | _offsets.resize(max_fetch + 1); | 249 | 5 | _offsets[0] = last_offset; | 250 | 7 | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { | 251 | 2 | const uint32_t start_offset = last_offset; | 252 | 2 | last_offset = guarded_offset(_cur_idx + 1); | 253 | 2 | _offsets[i + 1] = last_offset; | 254 | | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 255 | | if (_options.need_check_bitmap) { | 256 | | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset))); | 257 | | } | 258 | | } | 259 | 2 | } | 260 | 5 | _cur_idx++; | 261 | 5 | _offsets[max_fetch] = offset(_cur_idx); | 262 | | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 263 | | if (_options.need_check_bitmap) { | 264 | | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset))); | 265 | | } | 266 | | } | 267 | 5 | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); | 268 | | | 269 | 5 | *n = max_fetch; | 270 | 5 | return Status::OK(); | 271 | 6 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 239 | 1 | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 240 | 1 | DCHECK(_parsed); | 241 | 1 | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 242 | 0 | *n = 0; | 243 | 0 | return Status::OK(); | 244 | 0 | } | 245 | 1 | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 246 | | | 247 | 1 | uint32_t last_offset = guarded_offset(_cur_idx); | 248 | 1 | _offsets.resize(max_fetch + 1); | 249 | 1 | _offsets[0] = last_offset; | 250 | 3 | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { | 251 | 2 | const uint32_t start_offset = last_offset; | 252 | 2 | last_offset = guarded_offset(_cur_idx + 1); | 253 | 2 | _offsets[i + 1] = last_offset; | 254 | | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 255 | | if (_options.need_check_bitmap) { | 256 | | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset))); | 257 | | } | 258 | | } | 259 | 2 | } | 260 | 1 | _cur_idx++; | 261 | 1 | _offsets[max_fetch] = offset(_cur_idx); | 262 | | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 263 | | if (_options.need_check_bitmap) { | 264 | | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset))); | 265 | | } | 266 | | } | 267 | 1 | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); | 268 | | | 269 | 1 | *n = max_fetch; | 270 | 1 | return Status::OK(); | 271 | 1 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 239 | 43 | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 240 | 43 | DCHECK(_parsed); | 241 | 43 | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 242 | 0 | *n = 0; | 243 | 0 | return Status::OK(); | 244 | 0 | } | 245 | 43 | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 246 | | | 247 | 43 | uint32_t last_offset = guarded_offset(_cur_idx); | 248 | 43 | _offsets.resize(max_fetch + 1); | 249 | 43 | _offsets[0] = last_offset; | 250 | 43 | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { | 251 | 0 | const uint32_t start_offset = last_offset; | 252 | 0 | last_offset = guarded_offset(_cur_idx + 1); | 253 | 0 | _offsets[i + 1] = last_offset; | 254 | 0 | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 255 | 0 | if (_options.need_check_bitmap) { | 256 | 0 | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset))); | 257 | 0 | } | 258 | 0 | } | 259 | 0 | } | 260 | 43 | _cur_idx++; | 261 | 43 | _offsets[max_fetch] = offset(_cur_idx); | 262 | 43 | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 263 | 43 | if (_options.need_check_bitmap) { | 264 | 0 | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset))); | 265 | 0 | } | 266 | 43 | } | 267 | 43 | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); | 268 | | | 269 | 43 | *n = max_fetch; | 270 | 43 | return Status::OK(); | 271 | 43 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE |
272 | | |
273 | | Status read_by_rowids(const rowid_t* rowids, ordinal_t page_first_ordinal, size_t* n, |
274 | 509 | MutableColumnPtr& dst) override { |
275 | 509 | DCHECK(_parsed); |
276 | 509 | if (*n == 0) [[unlikely]] { |
277 | 0 | *n = 0; |
278 | 0 | return Status::OK(); |
279 | 0 | } |
280 | | |
281 | 509 | auto total = *n; |
282 | 509 | size_t read_count = 0; |
283 | 509 | _binary_data.resize(total); |
284 | 2.27k | for (size_t i = 0; i < total; ++i) { |
285 | 1.76k | ordinal_t ord = rowids[i] - page_first_ordinal; |
286 | 1.76k | if (UNLIKELY(ord >= _num_elems)) { |
287 | 0 | break; |
288 | 0 | } |
289 | | |
290 | 1.76k | const uint32_t start_offset = offset(ord); |
291 | 1.76k | _binary_data[read_count].data = _data.mutable_data() + start_offset; |
292 | 1.76k | _binary_data[read_count].size = offset(ord + 1) - start_offset; |
293 | 1.76k | read_count++; |
294 | 1.76k | } |
295 | | |
296 | 509 | if (LIKELY(read_count > 0)) { |
297 | 509 | dst->insert_many_strings(_binary_data.data(), read_count); |
298 | 509 | } |
299 | | |
300 | 509 | *n = read_count; |
301 | 509 | return Status::OK(); |
302 | 509 | } _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 274 | 508 | MutableColumnPtr& dst) override { | 275 | 508 | DCHECK(_parsed); | 276 | 508 | if (*n == 0) [[unlikely]] { | 277 | 0 | *n = 0; | 278 | 0 | return Status::OK(); | 279 | 0 | } | 280 | | | 281 | 508 | auto total = *n; | 282 | 508 | size_t read_count = 0; | 283 | 508 | _binary_data.resize(total); | 284 | 2.26k | for (size_t i = 0; i < total; ++i) { | 285 | 1.76k | ordinal_t ord = rowids[i] - page_first_ordinal; | 286 | 1.76k | if (UNLIKELY(ord >= _num_elems)) { | 287 | 0 | break; | 288 | 0 | } | 289 | | | 290 | 1.76k | const uint32_t start_offset = offset(ord); | 291 | 1.76k | _binary_data[read_count].data = _data.mutable_data() + start_offset; | 292 | 1.76k | _binary_data[read_count].size = offset(ord + 1) - start_offset; | 293 | 1.76k | read_count++; | 294 | 1.76k | } | 295 | | | 296 | 508 | if (LIKELY(read_count > 0)) { | 297 | 508 | dst->insert_many_strings(_binary_data.data(), read_count); | 298 | 508 | } | 299 | | | 300 | 508 | *n = read_count; | 301 | 508 | return Status::OK(); | 302 | 508 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 274 | 1 | MutableColumnPtr& dst) override { | 275 | 1 | DCHECK(_parsed); | 276 | 1 | if (*n == 0) [[unlikely]] { | 277 | 0 | *n = 0; | 278 | 0 | return Status::OK(); | 279 | 0 | } | 280 | | | 281 | 1 | auto total = *n; | 282 | 1 | size_t read_count = 0; | 283 | 1 | _binary_data.resize(total); | 284 | 5 | for (size_t i = 0; i < total; ++i) { | 285 | 4 | ordinal_t ord = rowids[i] - page_first_ordinal; | 286 | 4 | if (UNLIKELY(ord >= _num_elems)) { | 287 | 0 | break; | 288 | 0 | } | 289 | | | 290 | 4 | const uint32_t start_offset = offset(ord); | 291 | 4 | _binary_data[read_count].data = _data.mutable_data() + start_offset; | 292 | 4 | _binary_data[read_count].size = offset(ord + 1) - start_offset; | 293 | 4 | read_count++; | 294 | 4 | } | 295 | | | 296 | 1 | if (LIKELY(read_count > 0)) { | 297 | 1 | dst->insert_many_strings(_binary_data.data(), read_count); | 298 | 1 | } | 299 | | | 300 | 1 | *n = read_count; | 301 | 1 | return Status::OK(); | 302 | 1 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE |
303 | | |
304 | 5.54k | size_t count() const override { |
305 | 5.54k | DCHECK(_parsed); |
306 | 5.54k | return _num_elems; |
307 | 5.54k | } _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE5countEv Line | Count | Source | 304 | 5.54k | size_t count() const override { | 305 | | DCHECK(_parsed); | 306 | 5.54k | return _num_elems; | 307 | 5.54k | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE5countEv Line | Count | Source | 304 | 2 | size_t count() const override { | 305 | | DCHECK(_parsed); | 306 | 2 | return _num_elems; | 307 | 2 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE5countEv Line | Count | Source | 304 | 1 | size_t count() const override { | 305 | | DCHECK(_parsed); | 306 | 1 | return _num_elems; | 307 | 1 | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE5countEv |
308 | | |
309 | 138 | size_t current_index() const override { |
310 | 138 | DCHECK(_parsed); |
311 | 138 | return _cur_idx; |
312 | 138 | } _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE13current_indexEv Line | Count | Source | 309 | 91 | size_t current_index() const override { | 310 | | DCHECK(_parsed); | 311 | 91 | return _cur_idx; | 312 | 91 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE13current_indexEv Line | Count | Source | 309 | 4 | size_t current_index() const override { | 310 | | DCHECK(_parsed); | 311 | 4 | return _cur_idx; | 312 | 4 | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE13current_indexEv _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE13current_indexEv Line | Count | Source | 309 | 43 | size_t current_index() const override { | 310 | | DCHECK(_parsed); | 311 | 43 | return _cur_idx; | 312 | 43 | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE13current_indexEv |
313 | | |
314 | | Slice string_at_index(size_t idx) const { |
315 | | const uint32_t start_offset = offset(idx); |
316 | | uint32_t len = offset(idx + 1) - start_offset; |
317 | | return Slice(&_data[start_offset], len); |
318 | | } |
319 | | |
320 | 2.76k | Status get_dict_word_info(StringRef* dict_word_info) override { |
321 | 2.76k | if (UNLIKELY(_num_elems <= 0)) { |
322 | 0 | return Status::OK(); |
323 | 0 | } |
324 | | |
325 | 2.76k | char* data_begin = (char*)&_data[0]; |
326 | 2.76k | char* offset_ptr = (char*)&_data[_offsets_pos]; |
327 | | |
328 | 76.4k | for (uint32_t i = 0; i < _num_elems; ++i) { |
329 | 73.7k | uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr); |
330 | 73.7k | if (offset > _offsets_pos) { |
331 | 0 | return Status::Corruption( |
332 | 0 | "file corruption: offsets pos beyonds data_size: {}, num_element: {}" |
333 | 0 | ", offset_pos: {}, offset: {}", |
334 | 0 | _data.size, _num_elems, _offsets_pos, offset); |
335 | 0 | } |
336 | 73.7k | dict_word_info[i].data = data_begin + offset; |
337 | 73.7k | offset_ptr += sizeof(uint32_t); |
338 | 73.7k | } |
339 | | |
340 | 73.7k | for (int i = 0; i < (int)_num_elems - 1; ++i) { |
341 | 70.9k | dict_word_info[i].size = |
342 | 70.9k | (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data; |
343 | 70.9k | } |
344 | | |
345 | 2.76k | dict_word_info[_num_elems - 1].size = |
346 | 2.76k | (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data; |
347 | 2.76k | return Status::OK(); |
348 | 2.76k | } _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE18get_dict_word_infoEPNS_9StringRefE Line | Count | Source | 320 | 2.76k | Status get_dict_word_info(StringRef* dict_word_info) override { | 321 | 2.76k | if (UNLIKELY(_num_elems <= 0)) { | 322 | 0 | return Status::OK(); | 323 | 0 | } | 324 | | | 325 | 2.76k | char* data_begin = (char*)&_data[0]; | 326 | 2.76k | char* offset_ptr = (char*)&_data[_offsets_pos]; | 327 | | | 328 | 76.4k | for (uint32_t i = 0; i < _num_elems; ++i) { | 329 | 73.7k | uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr); | 330 | 73.7k | if (offset > _offsets_pos) { | 331 | 0 | return Status::Corruption( | 332 | 0 | "file corruption: offsets pos beyonds data_size: {}, num_element: {}" | 333 | 0 | ", offset_pos: {}, offset: {}", | 334 | 0 | _data.size, _num_elems, _offsets_pos, offset); | 335 | 0 | } | 336 | 73.7k | dict_word_info[i].data = data_begin + offset; | 337 | 73.7k | offset_ptr += sizeof(uint32_t); | 338 | 73.7k | } | 339 | | | 340 | 73.7k | for (int i = 0; i < (int)_num_elems - 1; ++i) { | 341 | 70.9k | dict_word_info[i].size = | 342 | 70.9k | (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data; | 343 | 70.9k | } | 344 | | | 345 | 2.76k | dict_word_info[_num_elems - 1].size = | 346 | 2.76k | (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data; | 347 | 2.76k | return Status::OK(); | 348 | 2.76k | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE18get_dict_word_infoEPNS_9StringRefE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE18get_dict_word_infoEPNS_9StringRefE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE18get_dict_word_infoEPNS_9StringRefE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE18get_dict_word_infoEPNS_9StringRefE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE18get_dict_word_infoEPNS_9StringRefE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE18get_dict_word_infoEPNS_9StringRefE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE18get_dict_word_infoEPNS_9StringRefE Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE18get_dict_word_infoEPNS_9StringRefE |
349 | | |
350 | | private: |
351 | | static constexpr size_t SIZE_OF_INT32 = sizeof(uint32_t); |
352 | | // Return the offset within '_data' where the string value with index 'idx' can be found. |
353 | 5.09k | uint32_t offset(size_t idx) const { |
354 | 5.09k | if (idx >= _num_elems) { |
355 | 1.97k | return _offsets_pos; |
356 | 1.97k | } |
357 | 3.12k | return guarded_offset(idx); |
358 | 5.09k | } _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE6offsetEm Line | Count | Source | 353 | 5.03k | uint32_t offset(size_t idx) const { | 354 | 5.03k | if (idx >= _num_elems) { | 355 | 1.94k | return _offsets_pos; | 356 | 1.94k | } | 357 | 3.09k | return guarded_offset(idx); | 358 | 5.03k | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE6offsetEm Line | Count | Source | 353 | 13 | uint32_t offset(size_t idx) const { | 354 | 13 | if (idx >= _num_elems) { | 355 | 4 | return _offsets_pos; | 356 | 4 | } | 357 | 9 | return guarded_offset(idx); | 358 | 13 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE6offsetEm Line | Count | Source | 353 | 1 | uint32_t offset(size_t idx) const { | 354 | 1 | if (idx >= _num_elems) { | 355 | 1 | return _offsets_pos; | 356 | 1 | } | 357 | 0 | return guarded_offset(idx); | 358 | 1 | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE6offsetEm Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE6offsetEm Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE6offsetEm _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE6offsetEm Line | Count | Source | 353 | 43 | uint32_t offset(size_t idx) const { | 354 | 43 | if (idx >= _num_elems) { | 355 | 21 | return _offsets_pos; | 356 | 21 | } | 357 | 22 | return guarded_offset(idx); | 358 | 43 | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE6offsetEm Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE6offsetEm |
359 | | |
360 | 308k | uint32_t guarded_offset(size_t idx) const { |
361 | 308k | const auto* p = |
362 | 308k | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); |
363 | 308k | return decode_fixed32_le(p); |
364 | 308k | } _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE14guarded_offsetEm Line | Count | Source | 360 | 308k | uint32_t guarded_offset(size_t idx) const { | 361 | 308k | const auto* p = | 362 | 308k | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); | 363 | 308k | return decode_fixed32_le(p); | 364 | 308k | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE14guarded_offsetEm Line | Count | Source | 360 | 16 | uint32_t guarded_offset(size_t idx) const { | 361 | 16 | const auto* p = | 362 | 16 | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); | 363 | 16 | return decode_fixed32_le(p); | 364 | 16 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE14guarded_offsetEm Line | Count | Source | 360 | 3 | uint32_t guarded_offset(size_t idx) const { | 361 | 3 | const auto* p = | 362 | 3 | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); | 363 | 3 | return decode_fixed32_le(p); | 364 | 3 | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE14guarded_offsetEm Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE14guarded_offsetEm Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE14guarded_offsetEm _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE14guarded_offsetEm Line | Count | Source | 360 | 65 | uint32_t guarded_offset(size_t idx) const { | 361 | 65 | const auto* p = | 362 | 65 | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); | 363 | 65 | return decode_fixed32_le(p); | 364 | 65 | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE14guarded_offsetEm Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE14guarded_offsetEm |
365 | | |
366 | | Slice _data; |
367 | | PageDecoderOptions _options; |
368 | | bool _parsed; |
369 | | |
370 | | uint32_t _num_elems; |
371 | | uint32_t _offsets_pos; |
372 | | |
373 | | std::vector<uint32_t> _offsets; |
374 | | std::vector<StringRef> _binary_data; |
375 | | |
376 | | // Index of the currently seeked element in the page. |
377 | | size_t _cur_idx; |
378 | | friend class BinaryDictPageDecoder; |
379 | | friend class FileColumnIterator; |
380 | | }; |
381 | | |
382 | | #include "common/compile_check_end.h" |
383 | | } // namespace segment_v2 |
384 | | } // namespace doris |