be/src/storage/segment/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 | | #pragma once |
19 | | |
20 | | #include "common/cast_set.h" |
21 | | #include "storage/olap_common.h" |
22 | | #include "storage/segment/options.h" |
23 | | #include "storage/segment/page_builder.h" |
24 | | #include "storage/segment/page_decoder.h" |
25 | | #include "storage/types.h" |
26 | | #include "util/coding.h" |
27 | | #include "util/faststring.h" |
28 | | #include "util/unaligned.h" |
29 | | |
30 | | namespace doris { |
31 | | namespace segment_v2 { |
32 | | |
33 | | static const size_t PLAIN_PAGE_HEADER_SIZE = sizeof(uint32_t); |
34 | | |
35 | | template <FieldType Type> |
36 | | class PlainPageBuilder : public PageBuilderHelper<PlainPageBuilder<Type>> { |
37 | | public: |
38 | | using Self = PlainPageBuilder<Type>; |
39 | | friend class PageBuilderHelper<Self>; |
40 | | |
41 | 154k | Status init() override { |
42 | | // Reserve enough space for the page, plus a bit of slop since |
43 | | // we often overrun the page by a few values. |
44 | 154k | return reset(); |
45 | 154k | } _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE4initEv Line | Count | Source | 41 | 47.5k | Status init() override { | 42 | | // Reserve enough space for the page, plus a bit of slop since | 43 | | // we often overrun the page by a few values. | 44 | 47.5k | return reset(); | 45 | 47.5k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE4initEv Line | Count | Source | 41 | 10.9k | Status init() override { | 42 | | // Reserve enough space for the page, plus a bit of slop since | 43 | | // we often overrun the page by a few values. | 44 | 10.9k | return reset(); | 45 | 10.9k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE4initEv Line | Count | Source | 41 | 48.8k | Status init() override { | 42 | | // Reserve enough space for the page, plus a bit of slop since | 43 | | // we often overrun the page by a few values. | 44 | 48.8k | return reset(); | 45 | 48.8k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE4initEv Line | Count | Source | 41 | 33.5k | Status init() override { | 42 | | // Reserve enough space for the page, plus a bit of slop since | 43 | | // we often overrun the page by a few values. | 44 | 33.5k | return reset(); | 45 | 33.5k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE4initEv Line | Count | Source | 41 | 13.5k | Status init() override { | 42 | | // Reserve enough space for the page, plus a bit of slop since | 43 | | // we often overrun the page by a few values. | 44 | 13.5k | return reset(); | 45 | 13.5k | } |
Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE10EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE11EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE24EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE14EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE28EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE29EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE15EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE40EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE16EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE31EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE32EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE33EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE37EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE38EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE39EE4initEv |
46 | | |
47 | 851k | bool is_page_full() override { return _remain_element_capacity == 0; }_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE12is_page_fullEv Line | Count | Source | 47 | 95.0k | bool is_page_full() override { return _remain_element_capacity == 0; } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE12is_page_fullEv Line | Count | Source | 47 | 32.0k | bool is_page_full() override { return _remain_element_capacity == 0; } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE12is_page_fullEv Line | Count | Source | 47 | 168k | bool is_page_full() override { return _remain_element_capacity == 0; } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE12is_page_fullEv Line | Count | Source | 47 | 459k | bool is_page_full() override { return _remain_element_capacity == 0; } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE12is_page_fullEv Line | Count | Source | 47 | 96.7k | bool is_page_full() override { return _remain_element_capacity == 0; } |
Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE10EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE11EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE24EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE14EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE28EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE29EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE15EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE40EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE16EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE31EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE32EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE33EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE37EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE38EE12is_page_fullEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE39EE12is_page_fullEv |
48 | | |
49 | 425k | Status add(const uint8_t* vals, size_t* count) override { |
50 | 425k | if (is_page_full() || *count == 0) { |
51 | 0 | *count = 0; |
52 | 0 | return Status::OK(); |
53 | 0 | } |
54 | 425k | size_t old_size = _buffer.size(); |
55 | 425k | size_t to_add = std::min(_remain_element_capacity, *count); |
56 | | // This may need a large memory, should return error if could not allocated |
57 | | // successfully, to avoid BE OOM. |
58 | 425k | RETURN_IF_CATCH_EXCEPTION(_buffer.resize(old_size + to_add * SIZE_OF_TYPE)); |
59 | 425k | memcpy(&_buffer[old_size], vals, to_add * SIZE_OF_TYPE); |
60 | 425k | _count += to_add; |
61 | 425k | _raw_data_size += to_add * SIZE_OF_TYPE; |
62 | | |
63 | 425k | *count = to_add; |
64 | 425k | _remain_element_capacity -= to_add; |
65 | 425k | return Status::OK(); |
66 | 425k | } _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE3addEPKhPm Line | Count | Source | 49 | 47.5k | Status add(const uint8_t* vals, size_t* count) override { | 50 | 47.5k | if (is_page_full() || *count == 0) { | 51 | 0 | *count = 0; | 52 | 0 | return Status::OK(); | 53 | 0 | } | 54 | 47.5k | size_t old_size = _buffer.size(); | 55 | 47.5k | size_t to_add = std::min(_remain_element_capacity, *count); | 56 | | // This may need a large memory, should return error if could not allocated | 57 | | // successfully, to avoid BE OOM. | 58 | 47.5k | RETURN_IF_CATCH_EXCEPTION(_buffer.resize(old_size + to_add * SIZE_OF_TYPE)); | 59 | 47.5k | memcpy(&_buffer[old_size], vals, to_add * SIZE_OF_TYPE); | 60 | 47.5k | _count += to_add; | 61 | 47.5k | _raw_data_size += to_add * SIZE_OF_TYPE; | 62 | | | 63 | 47.5k | *count = to_add; | 64 | 47.5k | _remain_element_capacity -= to_add; | 65 | 47.5k | return Status::OK(); | 66 | 47.5k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE3addEPKhPm Line | Count | Source | 49 | 16.0k | Status add(const uint8_t* vals, size_t* count) override { | 50 | 16.0k | if (is_page_full() || *count == 0) { | 51 | 0 | *count = 0; | 52 | 0 | return Status::OK(); | 53 | 0 | } | 54 | 16.0k | size_t old_size = _buffer.size(); | 55 | 16.0k | size_t to_add = std::min(_remain_element_capacity, *count); | 56 | | // This may need a large memory, should return error if could not allocated | 57 | | // successfully, to avoid BE OOM. | 58 | 16.0k | RETURN_IF_CATCH_EXCEPTION(_buffer.resize(old_size + to_add * SIZE_OF_TYPE)); | 59 | 16.0k | memcpy(&_buffer[old_size], vals, to_add * SIZE_OF_TYPE); | 60 | 16.0k | _count += to_add; | 61 | 16.0k | _raw_data_size += to_add * SIZE_OF_TYPE; | 62 | | | 63 | 16.0k | *count = to_add; | 64 | 16.0k | _remain_element_capacity -= to_add; | 65 | 16.0k | return Status::OK(); | 66 | 16.0k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE3addEPKhPm Line | Count | Source | 49 | 84.1k | Status add(const uint8_t* vals, size_t* count) override { | 50 | 84.1k | if (is_page_full() || *count == 0) { | 51 | 0 | *count = 0; | 52 | 0 | return Status::OK(); | 53 | 0 | } | 54 | 84.1k | size_t old_size = _buffer.size(); | 55 | 84.1k | size_t to_add = std::min(_remain_element_capacity, *count); | 56 | | // This may need a large memory, should return error if could not allocated | 57 | | // successfully, to avoid BE OOM. | 58 | 84.1k | RETURN_IF_CATCH_EXCEPTION(_buffer.resize(old_size + to_add * SIZE_OF_TYPE)); | 59 | 84.1k | memcpy(&_buffer[old_size], vals, to_add * SIZE_OF_TYPE); | 60 | 84.1k | _count += to_add; | 61 | 84.1k | _raw_data_size += to_add * SIZE_OF_TYPE; | 62 | | | 63 | 84.1k | *count = to_add; | 64 | 84.1k | _remain_element_capacity -= to_add; | 65 | 84.1k | return Status::OK(); | 66 | 84.1k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE3addEPKhPm Line | Count | Source | 49 | 229k | Status add(const uint8_t* vals, size_t* count) override { | 50 | 229k | if (is_page_full() || *count == 0) { | 51 | 0 | *count = 0; | 52 | 0 | return Status::OK(); | 53 | 0 | } | 54 | 229k | size_t old_size = _buffer.size(); | 55 | 229k | size_t to_add = std::min(_remain_element_capacity, *count); | 56 | | // This may need a large memory, should return error if could not allocated | 57 | | // successfully, to avoid BE OOM. | 58 | 229k | RETURN_IF_CATCH_EXCEPTION(_buffer.resize(old_size + to_add * SIZE_OF_TYPE)); | 59 | 229k | memcpy(&_buffer[old_size], vals, to_add * SIZE_OF_TYPE); | 60 | 229k | _count += to_add; | 61 | 229k | _raw_data_size += to_add * SIZE_OF_TYPE; | 62 | | | 63 | 229k | *count = to_add; | 64 | 229k | _remain_element_capacity -= to_add; | 65 | 229k | return Status::OK(); | 66 | 229k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE3addEPKhPm Line | Count | Source | 49 | 48.3k | Status add(const uint8_t* vals, size_t* count) override { | 50 | 48.3k | if (is_page_full() || *count == 0) { | 51 | 0 | *count = 0; | 52 | 0 | return Status::OK(); | 53 | 0 | } | 54 | 48.3k | size_t old_size = _buffer.size(); | 55 | 48.3k | size_t to_add = std::min(_remain_element_capacity, *count); | 56 | | // This may need a large memory, should return error if could not allocated | 57 | | // successfully, to avoid BE OOM. | 58 | 48.3k | RETURN_IF_CATCH_EXCEPTION(_buffer.resize(old_size + to_add * SIZE_OF_TYPE)); | 59 | 48.3k | memcpy(&_buffer[old_size], vals, to_add * SIZE_OF_TYPE); | 60 | 48.3k | _count += to_add; | 61 | 48.3k | _raw_data_size += to_add * SIZE_OF_TYPE; | 62 | | | 63 | 48.3k | *count = to_add; | 64 | 48.3k | _remain_element_capacity -= to_add; | 65 | 48.3k | return Status::OK(); | 66 | 48.3k | } |
Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE10EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE11EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE24EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE14EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE28EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE29EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE15EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE40EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE16EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE31EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE32EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE33EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE37EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE38EE3addEPKhPm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE39EE3addEPKhPm |
67 | | |
68 | 154k | Status finish(OwnedSlice* slice) override { |
69 | 154k | encode_fixed32_le((uint8_t*)&_buffer[0], cast_set<uint32_t>(_count)); |
70 | 154k | RETURN_IF_CATCH_EXCEPTION({ *slice = _buffer.build(); }); |
71 | 154k | return Status::OK(); |
72 | 154k | } _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE6finishEPNS_10OwnedSliceE Line | Count | Source | 68 | 46.6k | Status finish(OwnedSlice* slice) override { | 69 | 46.6k | encode_fixed32_le((uint8_t*)&_buffer[0], cast_set<uint32_t>(_count)); | 70 | 46.6k | RETURN_IF_CATCH_EXCEPTION({ *slice = _buffer.build(); }); | 71 | 46.6k | return Status::OK(); | 72 | 46.6k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE6finishEPNS_10OwnedSliceE Line | Count | Source | 68 | 10.1k | Status finish(OwnedSlice* slice) override { | 69 | 10.1k | encode_fixed32_le((uint8_t*)&_buffer[0], cast_set<uint32_t>(_count)); | 70 | 10.1k | RETURN_IF_CATCH_EXCEPTION({ *slice = _buffer.build(); }); | 71 | 10.1k | return Status::OK(); | 72 | 10.1k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE6finishEPNS_10OwnedSliceE Line | Count | Source | 68 | 49.2k | Status finish(OwnedSlice* slice) override { | 69 | 49.2k | encode_fixed32_le((uint8_t*)&_buffer[0], cast_set<uint32_t>(_count)); | 70 | 49.2k | RETURN_IF_CATCH_EXCEPTION({ *slice = _buffer.build(); }); | 71 | 49.2k | return Status::OK(); | 72 | 49.2k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE6finishEPNS_10OwnedSliceE Line | Count | Source | 68 | 35.3k | Status finish(OwnedSlice* slice) override { | 69 | 35.3k | encode_fixed32_le((uint8_t*)&_buffer[0], cast_set<uint32_t>(_count)); | 70 | 35.3k | RETURN_IF_CATCH_EXCEPTION({ *slice = _buffer.build(); }); | 71 | 35.3k | return Status::OK(); | 72 | 35.3k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE6finishEPNS_10OwnedSliceE Line | Count | Source | 68 | 13.3k | Status finish(OwnedSlice* slice) override { | 69 | 13.3k | encode_fixed32_le((uint8_t*)&_buffer[0], cast_set<uint32_t>(_count)); | 70 | 13.3k | RETURN_IF_CATCH_EXCEPTION({ *slice = _buffer.build(); }); | 71 | 13.3k | return Status::OK(); | 72 | 13.3k | } |
Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE10EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE11EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE24EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE14EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE28EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE29EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE15EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE40EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE16EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE31EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE32EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE33EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE37EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE38EE6finishEPNS_10OwnedSliceE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE39EE6finishEPNS_10OwnedSliceE |
73 | | |
74 | 309k | Status reset() override { |
75 | 309k | RETURN_IF_CATCH_EXCEPTION({ |
76 | 309k | _buffer.reserve(_options.data_page_size); |
77 | 309k | _count = 0; |
78 | 309k | _raw_data_size = 0; |
79 | 309k | _buffer.clear(); |
80 | 309k | _buffer.resize(PLAIN_PAGE_HEADER_SIZE); |
81 | 309k | _remain_element_capacity = _options.data_page_size / SIZE_OF_TYPE; |
82 | 309k | }); |
83 | 309k | return Status::OK(); |
84 | 309k | } _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE5resetEv Line | Count | Source | 74 | 94.1k | Status reset() override { | 75 | 94.1k | RETURN_IF_CATCH_EXCEPTION({ | 76 | 94.1k | _buffer.reserve(_options.data_page_size); | 77 | 94.1k | _count = 0; | 78 | 94.1k | _raw_data_size = 0; | 79 | 94.1k | _buffer.clear(); | 80 | 94.1k | _buffer.resize(PLAIN_PAGE_HEADER_SIZE); | 81 | 94.1k | _remain_element_capacity = _options.data_page_size / SIZE_OF_TYPE; | 82 | 94.1k | }); | 83 | 94.1k | return Status::OK(); | 84 | 94.1k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE5resetEv Line | Count | Source | 74 | 21.1k | Status reset() override { | 75 | 21.1k | RETURN_IF_CATCH_EXCEPTION({ | 76 | 21.1k | _buffer.reserve(_options.data_page_size); | 77 | 21.1k | _count = 0; | 78 | 21.1k | _raw_data_size = 0; | 79 | 21.1k | _buffer.clear(); | 80 | 21.1k | _buffer.resize(PLAIN_PAGE_HEADER_SIZE); | 81 | 21.1k | _remain_element_capacity = _options.data_page_size / SIZE_OF_TYPE; | 82 | 21.1k | }); | 83 | 21.1k | return Status::OK(); | 84 | 21.1k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE5resetEv Line | Count | Source | 74 | 98.1k | Status reset() override { | 75 | 98.1k | RETURN_IF_CATCH_EXCEPTION({ | 76 | 98.1k | _buffer.reserve(_options.data_page_size); | 77 | 98.1k | _count = 0; | 78 | 98.1k | _raw_data_size = 0; | 79 | 98.1k | _buffer.clear(); | 80 | 98.1k | _buffer.resize(PLAIN_PAGE_HEADER_SIZE); | 81 | 98.1k | _remain_element_capacity = _options.data_page_size / SIZE_OF_TYPE; | 82 | 98.1k | }); | 83 | 98.3k | return Status::OK(); | 84 | 98.1k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE5resetEv Line | Count | Source | 74 | 68.9k | Status reset() override { | 75 | 68.9k | RETURN_IF_CATCH_EXCEPTION({ | 76 | 68.9k | _buffer.reserve(_options.data_page_size); | 77 | 68.9k | _count = 0; | 78 | 68.9k | _raw_data_size = 0; | 79 | 68.9k | _buffer.clear(); | 80 | 68.9k | _buffer.resize(PLAIN_PAGE_HEADER_SIZE); | 81 | 68.9k | _remain_element_capacity = _options.data_page_size / SIZE_OF_TYPE; | 82 | 68.9k | }); | 83 | 68.9k | return Status::OK(); | 84 | 68.9k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE5resetEv Line | Count | Source | 74 | 26.9k | Status reset() override { | 75 | 26.9k | RETURN_IF_CATCH_EXCEPTION({ | 76 | 26.9k | _buffer.reserve(_options.data_page_size); | 77 | 26.9k | _count = 0; | 78 | 26.9k | _raw_data_size = 0; | 79 | 26.9k | _buffer.clear(); | 80 | 26.9k | _buffer.resize(PLAIN_PAGE_HEADER_SIZE); | 81 | 26.9k | _remain_element_capacity = _options.data_page_size / SIZE_OF_TYPE; | 82 | 26.9k | }); | 83 | 26.9k | return Status::OK(); | 84 | 26.9k | } |
Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE10EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE11EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE24EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE14EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE28EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE29EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE15EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE40EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE16EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE31EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE32EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE33EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE37EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE38EE5resetEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE39EE5resetEv |
85 | | |
86 | 0 | size_t count() const override { return _count; }Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE10EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE11EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE24EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE14EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE28EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE29EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE15EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE40EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE16EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE31EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE32EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE33EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE37EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE38EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE39EE5countEv |
87 | | |
88 | 9.62k | uint64_t size() const override { return _buffer.size(); }_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE4sizeEv Line | Count | Source | 88 | 1.70k | uint64_t size() const override { return _buffer.size(); } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE4sizeEv Line | Count | Source | 88 | 793 | uint64_t size() const override { return _buffer.size(); } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE4sizeEv Line | Count | Source | 88 | 3.62k | uint64_t size() const override { return _buffer.size(); } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE4sizeEv Line | Count | Source | 88 | 2.34k | uint64_t size() const override { return _buffer.size(); } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE4sizeEv Line | Count | Source | 88 | 1.16k | uint64_t size() const override { return _buffer.size(); } |
Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE10EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE11EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE24EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE14EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE28EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE29EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE15EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE40EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE16EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE31EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE32EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE33EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE37EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE38EE4sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE39EE4sizeEv |
89 | | |
90 | 154k | uint64_t get_raw_data_size() const override { return _raw_data_size; }_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE17get_raw_data_sizeEv Line | Count | Source | 90 | 46.6k | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE17get_raw_data_sizeEv Line | Count | Source | 90 | 10.1k | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE17get_raw_data_sizeEv Line | Count | Source | 90 | 49.2k | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE17get_raw_data_sizeEv Line | Count | Source | 90 | 35.3k | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE17get_raw_data_sizeEv Line | Count | Source | 90 | 13.3k | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE10EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE11EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE24EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE14EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE28EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE29EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE15EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE40EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE16EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE31EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE32EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE33EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE37EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE38EE17get_raw_data_sizeEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE39EE17get_raw_data_sizeEv |
91 | | |
92 | | private: |
93 | 154k | PlainPageBuilder(const PageBuilderOptions& options) : _options(options) {}_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 93 | 47.5k | PlainPageBuilder(const PageBuilderOptions& options) : _options(options) {} |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 93 | 10.9k | PlainPageBuilder(const PageBuilderOptions& options) : _options(options) {} |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 93 | 48.8k | PlainPageBuilder(const PageBuilderOptions& options) : _options(options) {} |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 93 | 33.5k | PlainPageBuilder(const PageBuilderOptions& options) : _options(options) {} |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 93 | 13.5k | PlainPageBuilder(const PageBuilderOptions& options) : _options(options) {} |
Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE10EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE11EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE24EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE14EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE28EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE29EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE15EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE40EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE16EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE31EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE32EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE33EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE37EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE38EEC2ERKNS0_18PageBuilderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE39EEC2ERKNS0_18PageBuilderOptionsE |
94 | | |
95 | | faststring _buffer; |
96 | | PageBuilderOptions _options; |
97 | | size_t _count; |
98 | | size_t _remain_element_capacity {0}; |
99 | | uint64_t _raw_data_size = 0; |
100 | | typedef typename TypeTraits<Type>::CppType CppType; |
101 | | enum { SIZE_OF_TYPE = TypeTraits<Type>::size }; |
102 | | }; |
103 | | |
104 | | template <FieldType Type> |
105 | | class PlainPageDecoder : public PageDecoder { |
106 | | public: |
107 | | PlainPageDecoder(Slice data, const PageDecoderOptions& options) |
108 | 452k | : _data(data), _options(options), _parsed(false), _num_elems(0), _cur_idx(0) {}_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 108 | 99.6k | : _data(data), _options(options), _parsed(false), _num_elems(0), _cur_idx(0) {} |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 108 | 21.2k | : _data(data), _options(options), _parsed(false), _num_elems(0), _cur_idx(0) {} |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 108 | 173k | : _data(data), _options(options), _parsed(false), _num_elems(0), _cur_idx(0) {} |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 108 | 136k | : _data(data), _options(options), _parsed(false), _num_elems(0), _cur_idx(0) {} |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 108 | 21.3k | : _data(data), _options(options), _parsed(false), _num_elems(0), _cur_idx(0) {} |
Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE10EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE11EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE24EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE14EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE28EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE29EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE15EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE40EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE16EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE31EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE32EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE33EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE37EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE38EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE39EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE |
109 | | |
110 | 451k | Status init() override { |
111 | 451k | CHECK(!_parsed); |
112 | | |
113 | 451k | if (_data.size < PLAIN_PAGE_HEADER_SIZE) { |
114 | 0 | return Status::InternalError( |
115 | 0 | "file corruption: not enough bytes for header in PlainPageDecoder ." |
116 | 0 | "invalid data size:{}, header size:{}", |
117 | 0 | _data.size, PLAIN_PAGE_HEADER_SIZE); |
118 | 0 | } |
119 | | |
120 | 451k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[0]); |
121 | | |
122 | 451k | if (_data.size != PLAIN_PAGE_HEADER_SIZE + _num_elems * SIZE_OF_TYPE) { |
123 | 0 | return Status::InternalError("file corruption: unexpected data size."); |
124 | 0 | } |
125 | | |
126 | 451k | _parsed = true; |
127 | | |
128 | 451k | RETURN_IF_ERROR(seek_to_position_in_page(0)); |
129 | 451k | return Status::OK(); |
130 | 451k | } _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EE4initEv Line | Count | Source | 110 | 99.6k | Status init() override { | 111 | 99.6k | CHECK(!_parsed); | 112 | | | 113 | 99.6k | if (_data.size < PLAIN_PAGE_HEADER_SIZE) { | 114 | 0 | return Status::InternalError( | 115 | 0 | "file corruption: not enough bytes for header in PlainPageDecoder ." | 116 | 0 | "invalid data size:{}, header size:{}", | 117 | 0 | _data.size, PLAIN_PAGE_HEADER_SIZE); | 118 | 0 | } | 119 | | | 120 | 99.6k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[0]); | 121 | | | 122 | 99.6k | if (_data.size != PLAIN_PAGE_HEADER_SIZE + _num_elems * SIZE_OF_TYPE) { | 123 | 0 | return Status::InternalError("file corruption: unexpected data size."); | 124 | 0 | } | 125 | | | 126 | 99.6k | _parsed = true; | 127 | | | 128 | 99.6k | RETURN_IF_ERROR(seek_to_position_in_page(0)); | 129 | 99.6k | return Status::OK(); | 130 | 99.6k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EE4initEv Line | Count | Source | 110 | 21.2k | Status init() override { | 111 | 21.2k | CHECK(!_parsed); | 112 | | | 113 | 21.2k | if (_data.size < PLAIN_PAGE_HEADER_SIZE) { | 114 | 0 | return Status::InternalError( | 115 | 0 | "file corruption: not enough bytes for header in PlainPageDecoder ." | 116 | 0 | "invalid data size:{}, header size:{}", | 117 | 0 | _data.size, PLAIN_PAGE_HEADER_SIZE); | 118 | 0 | } | 119 | | | 120 | 21.2k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[0]); | 121 | | | 122 | 21.2k | if (_data.size != PLAIN_PAGE_HEADER_SIZE + _num_elems * SIZE_OF_TYPE) { | 123 | 0 | return Status::InternalError("file corruption: unexpected data size."); | 124 | 0 | } | 125 | | | 126 | 21.2k | _parsed = true; | 127 | | | 128 | 21.2k | RETURN_IF_ERROR(seek_to_position_in_page(0)); | 129 | 21.2k | return Status::OK(); | 130 | 21.2k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EE4initEv Line | Count | Source | 110 | 173k | Status init() override { | 111 | 173k | CHECK(!_parsed); | 112 | | | 113 | 173k | if (_data.size < PLAIN_PAGE_HEADER_SIZE) { | 114 | 0 | return Status::InternalError( | 115 | 0 | "file corruption: not enough bytes for header in PlainPageDecoder ." | 116 | 0 | "invalid data size:{}, header size:{}", | 117 | 0 | _data.size, PLAIN_PAGE_HEADER_SIZE); | 118 | 0 | } | 119 | | | 120 | 173k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[0]); | 121 | | | 122 | 173k | if (_data.size != PLAIN_PAGE_HEADER_SIZE + _num_elems * SIZE_OF_TYPE) { | 123 | 0 | return Status::InternalError("file corruption: unexpected data size."); | 124 | 0 | } | 125 | | | 126 | 173k | _parsed = true; | 127 | | | 128 | 173k | RETURN_IF_ERROR(seek_to_position_in_page(0)); | 129 | 173k | return Status::OK(); | 130 | 173k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EE4initEv Line | Count | Source | 110 | 136k | Status init() override { | 111 | 136k | CHECK(!_parsed); | 112 | | | 113 | 136k | if (_data.size < PLAIN_PAGE_HEADER_SIZE) { | 114 | 0 | return Status::InternalError( | 115 | 0 | "file corruption: not enough bytes for header in PlainPageDecoder ." | 116 | 0 | "invalid data size:{}, header size:{}", | 117 | 0 | _data.size, PLAIN_PAGE_HEADER_SIZE); | 118 | 0 | } | 119 | | | 120 | 136k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[0]); | 121 | | | 122 | 136k | if (_data.size != PLAIN_PAGE_HEADER_SIZE + _num_elems * SIZE_OF_TYPE) { | 123 | 0 | return Status::InternalError("file corruption: unexpected data size."); | 124 | 0 | } | 125 | | | 126 | 136k | _parsed = true; | 127 | | | 128 | 136k | RETURN_IF_ERROR(seek_to_position_in_page(0)); | 129 | 136k | return Status::OK(); | 130 | 136k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EE4initEv Line | Count | Source | 110 | 21.3k | Status init() override { | 111 | 21.3k | CHECK(!_parsed); | 112 | | | 113 | 21.3k | if (_data.size < PLAIN_PAGE_HEADER_SIZE) { | 114 | 0 | return Status::InternalError( | 115 | 0 | "file corruption: not enough bytes for header in PlainPageDecoder ." | 116 | 0 | "invalid data size:{}, header size:{}", | 117 | 0 | _data.size, PLAIN_PAGE_HEADER_SIZE); | 118 | 0 | } | 119 | | | 120 | 21.3k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[0]); | 121 | | | 122 | 21.3k | if (_data.size != PLAIN_PAGE_HEADER_SIZE + _num_elems * SIZE_OF_TYPE) { | 123 | 0 | return Status::InternalError("file corruption: unexpected data size."); | 124 | 0 | } | 125 | | | 126 | 21.3k | _parsed = true; | 127 | | | 128 | 21.3k | RETURN_IF_ERROR(seek_to_position_in_page(0)); | 129 | 21.3k | return Status::OK(); | 130 | 21.3k | } |
Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE10EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE11EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE24EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE14EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE28EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE29EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE15EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE40EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE16EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE31EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE32EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE33EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE37EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE38EE4initEv Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE39EE4initEv |
131 | | |
132 | 1.43M | Status seek_to_position_in_page(size_t pos) override { |
133 | 18.4E | CHECK(_parsed) << "Must call init()"; |
134 | 1.43M | if (_num_elems == 0) [[unlikely]] { |
135 | 8.30k | if (pos != 0) { |
136 | 0 | return Status::Error<ErrorCode::INTERNAL_ERROR, false>( |
137 | 0 | "seek pos {} is larger than total elements {}", pos, _num_elems); |
138 | 0 | } |
139 | 8.30k | } |
140 | | |
141 | 1.43M | DCHECK_LE(pos, _num_elems); |
142 | | |
143 | 1.43M | _cur_idx = cast_set<uint32_t>(pos); |
144 | 1.43M | return Status::OK(); |
145 | 1.43M | } _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EE24seek_to_position_in_pageEm Line | Count | Source | 132 | 173k | Status seek_to_position_in_page(size_t pos) override { | 133 | 18.4E | CHECK(_parsed) << "Must call init()"; | 134 | 173k | if (_num_elems == 0) [[unlikely]] { | 135 | 1.31k | if (pos != 0) { | 136 | 0 | return Status::Error<ErrorCode::INTERNAL_ERROR, false>( | 137 | 0 | "seek pos {} is larger than total elements {}", pos, _num_elems); | 138 | 0 | } | 139 | 1.31k | } | 140 | | | 141 | 173k | DCHECK_LE(pos, _num_elems); | 142 | | | 143 | 173k | _cur_idx = cast_set<uint32_t>(pos); | 144 | 173k | return Status::OK(); | 145 | 173k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EE24seek_to_position_in_pageEm Line | Count | Source | 132 | 38.7k | Status seek_to_position_in_page(size_t pos) override { | 133 | 18.4E | CHECK(_parsed) << "Must call init()"; | 134 | 38.7k | if (_num_elems == 0) [[unlikely]] { | 135 | 785 | if (pos != 0) { | 136 | 0 | return Status::Error<ErrorCode::INTERNAL_ERROR, false>( | 137 | 0 | "seek pos {} is larger than total elements {}", pos, _num_elems); | 138 | 0 | } | 139 | 785 | } | 140 | | | 141 | 38.7k | DCHECK_LE(pos, _num_elems); | 142 | | | 143 | 38.7k | _cur_idx = cast_set<uint32_t>(pos); | 144 | 38.7k | return Status::OK(); | 145 | 38.7k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EE24seek_to_position_in_pageEm Line | Count | Source | 132 | 840k | Status seek_to_position_in_page(size_t pos) override { | 133 | 18.4E | CHECK(_parsed) << "Must call init()"; | 134 | 840k | if (_num_elems == 0) [[unlikely]] { | 135 | 3.51k | if (pos != 0) { | 136 | 0 | return Status::Error<ErrorCode::INTERNAL_ERROR, false>( | 137 | 0 | "seek pos {} is larger than total elements {}", pos, _num_elems); | 138 | 0 | } | 139 | 3.51k | } | 140 | | | 141 | 840k | DCHECK_LE(pos, _num_elems); | 142 | | | 143 | 840k | _cur_idx = cast_set<uint32_t>(pos); | 144 | 840k | return Status::OK(); | 145 | 840k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EE24seek_to_position_in_pageEm Line | Count | Source | 132 | 348k | Status seek_to_position_in_page(size_t pos) override { | 133 | 18.4E | CHECK(_parsed) << "Must call init()"; | 134 | 348k | if (_num_elems == 0) [[unlikely]] { | 135 | 2.06k | if (pos != 0) { | 136 | 0 | return Status::Error<ErrorCode::INTERNAL_ERROR, false>( | 137 | 0 | "seek pos {} is larger than total elements {}", pos, _num_elems); | 138 | 0 | } | 139 | 2.06k | } | 140 | | | 141 | 348k | DCHECK_LE(pos, _num_elems); | 142 | | | 143 | 348k | _cur_idx = cast_set<uint32_t>(pos); | 144 | 348k | return Status::OK(); | 145 | 348k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EE24seek_to_position_in_pageEm Line | Count | Source | 132 | 32.1k | Status seek_to_position_in_page(size_t pos) override { | 133 | 32.1k | CHECK(_parsed) << "Must call init()"; | 134 | 32.1k | if (_num_elems == 0) [[unlikely]] { | 135 | 624 | if (pos != 0) { | 136 | 0 | return Status::Error<ErrorCode::INTERNAL_ERROR, false>( | 137 | 0 | "seek pos {} is larger than total elements {}", pos, _num_elems); | 138 | 0 | } | 139 | 624 | } | 140 | | | 141 | 32.1k | DCHECK_LE(pos, _num_elems); | 142 | | | 143 | 32.1k | _cur_idx = cast_set<uint32_t>(pos); | 144 | 32.1k | return Status::OK(); | 145 | 32.1k | } |
Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE10EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE11EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE24EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE14EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE28EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE29EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE15EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE40EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE16EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE31EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE32EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE33EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE37EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE38EE24seek_to_position_in_pageEm Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE39EE24seek_to_position_in_pageEm |
146 | | |
147 | 0 | Status seek_at_or_after_value(const void* value, bool* exact_match) override { |
148 | 0 | DCHECK(_parsed) << "Must call init() firstly"; |
149 | |
|
150 | 0 | if (_num_elems == 0) { |
151 | 0 | return Status::Error<ErrorCode::ENTRY_NOT_FOUND>("page is empty"); |
152 | 0 | } |
153 | | |
154 | 0 | uint32_t left = 0; |
155 | 0 | uint32_t right = _num_elems; |
156 | |
|
157 | 0 | const void* mid_value = nullptr; |
158 | | |
159 | | // find the first value >= target. after loop, |
160 | | // - left == index of first value >= target when found |
161 | | // - left == _num_elems when not found (all values < target) |
162 | 0 | while (left < right) { |
163 | 0 | uint32_t mid = left + (right - left) / 2; |
164 | 0 | mid_value = &_data[PLAIN_PAGE_HEADER_SIZE + mid * SIZE_OF_TYPE]; |
165 | 0 | if (TypeTraits<Type>::cmp(mid_value, value) < 0) { |
166 | 0 | left = mid + 1; |
167 | 0 | } else { |
168 | 0 | right = mid; |
169 | 0 | } |
170 | 0 | } |
171 | 0 | if (left >= _num_elems) { |
172 | 0 | return Status::Error<ErrorCode::ENTRY_NOT_FOUND>("all value small than the value"); |
173 | 0 | } |
174 | 0 | const void* find_value = &_data[PLAIN_PAGE_HEADER_SIZE + left * SIZE_OF_TYPE]; |
175 | 0 | if (TypeTraits<Type>::cmp(find_value, value) == 0) { |
176 | 0 | *exact_match = true; |
177 | 0 | } else { |
178 | 0 | *exact_match = false; |
179 | 0 | } |
180 | |
|
181 | 0 | _cur_idx = left; |
182 | 0 | return Status::OK(); |
183 | 0 | } Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE10EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE11EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE24EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE14EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE28EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE29EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE15EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE40EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE16EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE31EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE32EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE33EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE37EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE38EE22seek_at_or_after_valueEPKvPb Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE39EE22seek_at_or_after_valueEPKvPb |
184 | | |
185 | 1.29M | Status next_batch(size_t* n, MutableColumnPtr& dst) override { |
186 | 1.29M | DCHECK(_parsed); |
187 | 1.29M | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { |
188 | 0 | return Status::OK(); |
189 | 0 | } |
190 | | |
191 | 1.29M | size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); |
192 | 1.29M | const void* src_data = &_data[PLAIN_PAGE_HEADER_SIZE + _cur_idx * SIZE_OF_TYPE]; |
193 | | |
194 | 1.29M | dst->insert_many_fix_len_data((const char*)src_data, max_fetch); |
195 | | |
196 | 1.29M | *n = max_fetch; |
197 | 1.29M | _cur_idx += max_fetch; |
198 | | |
199 | 1.29M | return Status::OK(); |
200 | 1.29M | } _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 185 | 333k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 186 | 333k | DCHECK(_parsed); | 187 | 333k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 188 | 0 | return Status::OK(); | 189 | 0 | } | 190 | | | 191 | 333k | size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 192 | 333k | const void* src_data = &_data[PLAIN_PAGE_HEADER_SIZE + _cur_idx * SIZE_OF_TYPE]; | 193 | | | 194 | 333k | dst->insert_many_fix_len_data((const char*)src_data, max_fetch); | 195 | | | 196 | 333k | *n = max_fetch; | 197 | 333k | _cur_idx += max_fetch; | 198 | | | 199 | 333k | return Status::OK(); | 200 | 333k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 185 | 18.6k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 186 | 18.6k | DCHECK(_parsed); | 187 | 18.6k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 188 | 0 | return Status::OK(); | 189 | 0 | } | 190 | | | 191 | 18.6k | size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 192 | 18.6k | const void* src_data = &_data[PLAIN_PAGE_HEADER_SIZE + _cur_idx * SIZE_OF_TYPE]; | 193 | | | 194 | 18.6k | dst->insert_many_fix_len_data((const char*)src_data, max_fetch); | 195 | | | 196 | 18.6k | *n = max_fetch; | 197 | 18.6k | _cur_idx += max_fetch; | 198 | | | 199 | 18.6k | return Status::OK(); | 200 | 18.6k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 185 | 748k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 186 | 748k | DCHECK(_parsed); | 187 | 748k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 188 | 0 | return Status::OK(); | 189 | 0 | } | 190 | | | 191 | 748k | size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 192 | 748k | const void* src_data = &_data[PLAIN_PAGE_HEADER_SIZE + _cur_idx * SIZE_OF_TYPE]; | 193 | | | 194 | 748k | dst->insert_many_fix_len_data((const char*)src_data, max_fetch); | 195 | | | 196 | 748k | *n = max_fetch; | 197 | 748k | _cur_idx += max_fetch; | 198 | | | 199 | 748k | return Status::OK(); | 200 | 748k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 185 | 164k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 186 | 164k | DCHECK(_parsed); | 187 | 164k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 188 | 0 | return Status::OK(); | 189 | 0 | } | 190 | | | 191 | 164k | size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 192 | 164k | const void* src_data = &_data[PLAIN_PAGE_HEADER_SIZE + _cur_idx * SIZE_OF_TYPE]; | 193 | | | 194 | 164k | dst->insert_many_fix_len_data((const char*)src_data, max_fetch); | 195 | | | 196 | 164k | *n = max_fetch; | 197 | 164k | _cur_idx += max_fetch; | 198 | | | 199 | 164k | return Status::OK(); | 200 | 164k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 185 | 30.9k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 186 | 30.9k | DCHECK(_parsed); | 187 | 30.9k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 188 | 0 | return Status::OK(); | 189 | 0 | } | 190 | | | 191 | 30.9k | size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 192 | 30.9k | const void* src_data = &_data[PLAIN_PAGE_HEADER_SIZE + _cur_idx * SIZE_OF_TYPE]; | 193 | | | 194 | 30.9k | dst->insert_many_fix_len_data((const char*)src_data, max_fetch); | 195 | | | 196 | 30.9k | *n = max_fetch; | 197 | 30.9k | _cur_idx += max_fetch; | 198 | | | 199 | 30.9k | return Status::OK(); | 200 | 30.9k | } |
Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE10EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE11EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE24EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE14EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE28EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE29EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE15EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE40EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE16EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE31EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE32EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE33EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE37EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE38EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE39EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE |
201 | | |
202 | | Status read_by_rowids(const rowid_t* rowids, ordinal_t page_first_ordinal, size_t* n, |
203 | 162k | MutableColumnPtr& dst) override { |
204 | 162k | DCHECK(_parsed); |
205 | 162k | if (*n == 0) [[unlikely]] { |
206 | 0 | return Status::OK(); |
207 | 0 | } |
208 | | |
209 | 162k | auto total = *n; |
210 | 162k | auto read_count = 0; |
211 | 162k | _buffer.resize(total); |
212 | 68.3M | for (size_t i = 0; i < total; ++i) { |
213 | 68.1M | ordinal_t ord = rowids[i] - page_first_ordinal; |
214 | 68.1M | if (UNLIKELY(ord >= _num_elems)) { |
215 | 5.42k | break; |
216 | 5.42k | } |
217 | | |
218 | 68.1M | _buffer[read_count++] = |
219 | 68.1M | unaligned_load<CppType>(&_data[PLAIN_PAGE_HEADER_SIZE + ord * SIZE_OF_TYPE]); |
220 | 68.1M | } |
221 | | |
222 | 162k | if (LIKELY(read_count > 0)) { |
223 | 162k | dst->insert_many_fix_len_data((char*)_buffer.data(), read_count); |
224 | 162k | } |
225 | | |
226 | 162k | *n = read_count; |
227 | 162k | return Status::OK(); |
228 | 162k | } _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 203 | 22.9k | MutableColumnPtr& dst) override { | 204 | 22.9k | DCHECK(_parsed); | 205 | 22.9k | if (*n == 0) [[unlikely]] { | 206 | 0 | return Status::OK(); | 207 | 0 | } | 208 | | | 209 | 22.9k | auto total = *n; | 210 | 22.9k | auto read_count = 0; | 211 | 22.9k | _buffer.resize(total); | 212 | 1.22M | for (size_t i = 0; i < total; ++i) { | 213 | 1.20M | ordinal_t ord = rowids[i] - page_first_ordinal; | 214 | 1.20M | if (UNLIKELY(ord >= _num_elems)) { | 215 | 121 | break; | 216 | 121 | } | 217 | | | 218 | 1.20M | _buffer[read_count++] = | 219 | 1.20M | unaligned_load<CppType>(&_data[PLAIN_PAGE_HEADER_SIZE + ord * SIZE_OF_TYPE]); | 220 | 1.20M | } | 221 | | | 222 | 22.9k | if (LIKELY(read_count > 0)) { | 223 | 22.9k | dst->insert_many_fix_len_data((char*)_buffer.data(), read_count); | 224 | 22.9k | } | 225 | | | 226 | 22.9k | *n = read_count; | 227 | 22.9k | return Status::OK(); | 228 | 22.9k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 203 | 9.94k | MutableColumnPtr& dst) override { | 204 | 9.94k | DCHECK(_parsed); | 205 | 9.94k | if (*n == 0) [[unlikely]] { | 206 | 0 | return Status::OK(); | 207 | 0 | } | 208 | | | 209 | 9.94k | auto total = *n; | 210 | 9.94k | auto read_count = 0; | 211 | 9.94k | _buffer.resize(total); | 212 | 683k | for (size_t i = 0; i < total; ++i) { | 213 | 674k | ordinal_t ord = rowids[i] - page_first_ordinal; | 214 | 674k | if (UNLIKELY(ord >= _num_elems)) { | 215 | 13 | break; | 216 | 13 | } | 217 | | | 218 | 673k | _buffer[read_count++] = | 219 | 673k | unaligned_load<CppType>(&_data[PLAIN_PAGE_HEADER_SIZE + ord * SIZE_OF_TYPE]); | 220 | 673k | } | 221 | | | 222 | 9.94k | if (LIKELY(read_count > 0)) { | 223 | 9.94k | dst->insert_many_fix_len_data((char*)_buffer.data(), read_count); | 224 | 9.94k | } | 225 | | | 226 | 9.94k | *n = read_count; | 227 | 9.94k | return Status::OK(); | 228 | 9.94k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 203 | 82.5k | MutableColumnPtr& dst) override { | 204 | 82.5k | DCHECK(_parsed); | 205 | 82.5k | if (*n == 0) [[unlikely]] { | 206 | 0 | return Status::OK(); | 207 | 0 | } | 208 | | | 209 | 82.5k | auto total = *n; | 210 | 82.5k | auto read_count = 0; | 211 | 82.5k | _buffer.resize(total); | 212 | 36.9M | for (size_t i = 0; i < total; ++i) { | 213 | 36.9M | ordinal_t ord = rowids[i] - page_first_ordinal; | 214 | 36.9M | if (UNLIKELY(ord >= _num_elems)) { | 215 | 2.91k | break; | 216 | 2.91k | } | 217 | | | 218 | 36.9M | _buffer[read_count++] = | 219 | 36.9M | unaligned_load<CppType>(&_data[PLAIN_PAGE_HEADER_SIZE + ord * SIZE_OF_TYPE]); | 220 | 36.9M | } | 221 | | | 222 | 82.5k | if (LIKELY(read_count > 0)) { | 223 | 82.5k | dst->insert_many_fix_len_data((char*)_buffer.data(), read_count); | 224 | 82.5k | } | 225 | | | 226 | 82.5k | *n = read_count; | 227 | 82.5k | return Status::OK(); | 228 | 82.5k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 203 | 36.7k | MutableColumnPtr& dst) override { | 204 | 36.7k | DCHECK(_parsed); | 205 | 36.7k | if (*n == 0) [[unlikely]] { | 206 | 0 | return Status::OK(); | 207 | 0 | } | 208 | | | 209 | 36.7k | auto total = *n; | 210 | 36.7k | auto read_count = 0; | 211 | 36.7k | _buffer.resize(total); | 212 | 28.0M | for (size_t i = 0; i < total; ++i) { | 213 | 28.0M | ordinal_t ord = rowids[i] - page_first_ordinal; | 214 | 28.0M | if (UNLIKELY(ord >= _num_elems)) { | 215 | 2.07k | break; | 216 | 2.07k | } | 217 | | | 218 | 28.0M | _buffer[read_count++] = | 219 | 28.0M | unaligned_load<CppType>(&_data[PLAIN_PAGE_HEADER_SIZE + ord * SIZE_OF_TYPE]); | 220 | 28.0M | } | 221 | | | 222 | 36.7k | if (LIKELY(read_count > 0)) { | 223 | 36.7k | dst->insert_many_fix_len_data((char*)_buffer.data(), read_count); | 224 | 36.7k | } | 225 | | | 226 | 36.7k | *n = read_count; | 227 | 36.7k | return Status::OK(); | 228 | 36.7k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 203 | 9.99k | MutableColumnPtr& dst) override { | 204 | 9.99k | DCHECK(_parsed); | 205 | 9.99k | if (*n == 0) [[unlikely]] { | 206 | 0 | return Status::OK(); | 207 | 0 | } | 208 | | | 209 | 9.99k | auto total = *n; | 210 | 9.99k | auto read_count = 0; | 211 | 9.99k | _buffer.resize(total); | 212 | 1.32M | for (size_t i = 0; i < total; ++i) { | 213 | 1.31M | ordinal_t ord = rowids[i] - page_first_ordinal; | 214 | 1.31M | if (UNLIKELY(ord >= _num_elems)) { | 215 | 298 | break; | 216 | 298 | } | 217 | | | 218 | 1.31M | _buffer[read_count++] = | 219 | 1.31M | unaligned_load<CppType>(&_data[PLAIN_PAGE_HEADER_SIZE + ord * SIZE_OF_TYPE]); | 220 | 1.31M | } | 221 | | | 222 | 9.99k | if (LIKELY(read_count > 0)) { | 223 | 9.99k | dst->insert_many_fix_len_data((char*)_buffer.data(), read_count); | 224 | 9.99k | } | 225 | | | 226 | 9.99k | *n = read_count; | 227 | 9.99k | return Status::OK(); | 228 | 9.99k | } |
Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE10EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE11EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE24EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE14EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE28EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE29EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE15EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE40EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE16EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE31EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE32EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE33EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE37EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE38EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Unexecuted instantiation: _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE39EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE |
229 | | |
230 | 0 | size_t count() const override { |
231 | 0 | DCHECK(_parsed); |
232 | 0 | return _num_elems; |
233 | 0 | } Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE10EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE11EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE24EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE14EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE28EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE29EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE15EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE40EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE16EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE31EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE32EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE33EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE37EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE38EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE39EE5countEv |
234 | | |
235 | 219k | size_t current_index() const override { |
236 | | DCHECK(_parsed); |
237 | 219k | return _cur_idx; |
238 | 219k | } _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EE13current_indexEv Line | Count | Source | 235 | 15.6k | size_t current_index() const override { | 236 | | DCHECK(_parsed); | 237 | 15.6k | return _cur_idx; | 238 | 15.6k | } |
_ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EE13current_indexEv Line | Count | Source | 235 | 14.1k | size_t current_index() const override { | 236 | | DCHECK(_parsed); | 237 | 14.1k | return _cur_idx; | 238 | 14.1k | } |
_ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EE13current_indexEv Line | Count | Source | 235 | 23.0k | size_t current_index() const override { | 236 | | DCHECK(_parsed); | 237 | 23.0k | return _cur_idx; | 238 | 23.0k | } |
_ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EE13current_indexEv Line | Count | Source | 235 | 161k | size_t current_index() const override { | 236 | | DCHECK(_parsed); | 237 | 161k | return _cur_idx; | 238 | 161k | } |
_ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EE13current_indexEv Line | Count | Source | 235 | 4.83k | size_t current_index() const override { | 236 | | DCHECK(_parsed); | 237 | 4.83k | return _cur_idx; | 238 | 4.83k | } |
Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE10EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE11EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE24EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE14EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE28EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE29EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE15EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE40EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE16EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE31EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE32EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE33EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE37EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE38EE13current_indexEv Unexecuted instantiation: _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE39EE13current_indexEv |
239 | | |
240 | | private: |
241 | | Slice _data; |
242 | | PageDecoderOptions _options; |
243 | | bool _parsed; |
244 | | uint32_t _num_elems; |
245 | | uint32_t _cur_idx; |
246 | | typedef typename TypeTraits<Type>::CppType CppType; |
247 | | enum { SIZE_OF_TYPE = TypeTraits<Type>::size }; |
248 | | |
249 | | std::vector<std::conditional_t<std::is_same_v<CppType, bool>, uint8_t, CppType>> _buffer; |
250 | | }; |
251 | | |
252 | | } // namespace segment_v2 |
253 | | } // namespace doris |