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 | 142k | 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 | 142k | return reset(); |
45 | 142k | } _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE4initEv Line | Count | Source | 41 | 38.4k | 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 | 38.4k | return reset(); | 45 | 38.4k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE4initEv Line | Count | Source | 41 | 8.86k | 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 | 8.86k | return reset(); | 45 | 8.86k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE4initEv Line | Count | Source | 41 | 43.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 | 43.8k | return reset(); | 45 | 43.8k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE4initEv Line | Count | Source | 41 | 40.1k | 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 | 40.1k | return reset(); | 45 | 40.1k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE4initEv Line | Count | Source | 41 | 11.6k | 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 | 11.6k | return reset(); | 45 | 11.6k | } |
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 | 493k | bool is_page_full() override { return _remain_element_capacity == 0; }_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE12is_page_fullEv Line | Count | Source | 47 | 85.4k | bool is_page_full() override { return _remain_element_capacity == 0; } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE12is_page_fullEv Line | Count | Source | 47 | 28.5k | bool is_page_full() override { return _remain_element_capacity == 0; } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE12is_page_fullEv Line | Count | Source | 47 | 170k | bool is_page_full() override { return _remain_element_capacity == 0; } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE12is_page_fullEv Line | Count | Source | 47 | 105k | bool is_page_full() override { return _remain_element_capacity == 0; } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE12is_page_fullEv Line | Count | Source | 47 | 103k | 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 | 246k | Status add(const uint8_t* vals, size_t* count) override { |
50 | 246k | if (is_page_full() || *count == 0) { |
51 | 0 | *count = 0; |
52 | 0 | return Status::OK(); |
53 | 0 | } |
54 | 246k | size_t old_size = _buffer.size(); |
55 | 246k | 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 | 246k | RETURN_IF_CATCH_EXCEPTION(_buffer.resize(old_size + to_add * SIZE_OF_TYPE)); |
59 | 246k | memcpy(&_buffer[old_size], vals, to_add * SIZE_OF_TYPE); |
60 | 246k | _count += to_add; |
61 | 246k | _raw_data_size += to_add * SIZE_OF_TYPE; |
62 | | |
63 | 246k | *count = to_add; |
64 | 246k | _remain_element_capacity -= to_add; |
65 | 246k | return Status::OK(); |
66 | 246k | } _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE3addEPKhPm Line | Count | Source | 49 | 42.7k | Status add(const uint8_t* vals, size_t* count) override { | 50 | 42.7k | if (is_page_full() || *count == 0) { | 51 | 0 | *count = 0; | 52 | 0 | return Status::OK(); | 53 | 0 | } | 54 | 42.7k | size_t old_size = _buffer.size(); | 55 | 42.7k | 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 | 42.7k | RETURN_IF_CATCH_EXCEPTION(_buffer.resize(old_size + to_add * SIZE_OF_TYPE)); | 59 | 42.7k | memcpy(&_buffer[old_size], vals, to_add * SIZE_OF_TYPE); | 60 | 42.7k | _count += to_add; | 61 | 42.7k | _raw_data_size += to_add * SIZE_OF_TYPE; | 62 | | | 63 | 42.7k | *count = to_add; | 64 | 42.7k | _remain_element_capacity -= to_add; | 65 | 42.7k | return Status::OK(); | 66 | 42.7k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE3addEPKhPm Line | Count | Source | 49 | 14.2k | Status add(const uint8_t* vals, size_t* count) override { | 50 | 14.2k | if (is_page_full() || *count == 0) { | 51 | 0 | *count = 0; | 52 | 0 | return Status::OK(); | 53 | 0 | } | 54 | 14.2k | size_t old_size = _buffer.size(); | 55 | 14.2k | 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 | 14.2k | RETURN_IF_CATCH_EXCEPTION(_buffer.resize(old_size + to_add * SIZE_OF_TYPE)); | 59 | 14.2k | memcpy(&_buffer[old_size], vals, to_add * SIZE_OF_TYPE); | 60 | 14.2k | _count += to_add; | 61 | 14.2k | _raw_data_size += to_add * SIZE_OF_TYPE; | 62 | | | 63 | 14.2k | *count = to_add; | 64 | 14.2k | _remain_element_capacity -= to_add; | 65 | 14.2k | return Status::OK(); | 66 | 14.2k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE3addEPKhPm Line | Count | Source | 49 | 85.3k | Status add(const uint8_t* vals, size_t* count) override { | 50 | 85.3k | if (is_page_full() || *count == 0) { | 51 | 0 | *count = 0; | 52 | 0 | return Status::OK(); | 53 | 0 | } | 54 | 85.3k | size_t old_size = _buffer.size(); | 55 | 85.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 | 85.3k | RETURN_IF_CATCH_EXCEPTION(_buffer.resize(old_size + to_add * SIZE_OF_TYPE)); | 59 | 85.2k | memcpy(&_buffer[old_size], vals, to_add * SIZE_OF_TYPE); | 60 | 85.2k | _count += to_add; | 61 | 85.2k | _raw_data_size += to_add * SIZE_OF_TYPE; | 62 | | | 63 | 85.2k | *count = to_add; | 64 | 85.2k | _remain_element_capacity -= to_add; | 65 | 85.2k | return Status::OK(); | 66 | 85.3k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE3addEPKhPm Line | Count | Source | 49 | 52.5k | Status add(const uint8_t* vals, size_t* count) override { | 50 | 52.5k | if (is_page_full() || *count == 0) { | 51 | 0 | *count = 0; | 52 | 0 | return Status::OK(); | 53 | 0 | } | 54 | 52.5k | size_t old_size = _buffer.size(); | 55 | 52.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 | 52.5k | RETURN_IF_CATCH_EXCEPTION(_buffer.resize(old_size + to_add * SIZE_OF_TYPE)); | 59 | 52.5k | memcpy(&_buffer[old_size], vals, to_add * SIZE_OF_TYPE); | 60 | 52.5k | _count += to_add; | 61 | 52.5k | _raw_data_size += to_add * SIZE_OF_TYPE; | 62 | | | 63 | 52.5k | *count = to_add; | 64 | 52.5k | _remain_element_capacity -= to_add; | 65 | 52.5k | return Status::OK(); | 66 | 52.5k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE3addEPKhPm Line | Count | Source | 49 | 51.7k | Status add(const uint8_t* vals, size_t* count) override { | 50 | 51.7k | if (is_page_full() || *count == 0) { | 51 | 0 | *count = 0; | 52 | 0 | return Status::OK(); | 53 | 0 | } | 54 | 51.7k | size_t old_size = _buffer.size(); | 55 | 51.7k | 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 | 51.7k | RETURN_IF_CATCH_EXCEPTION(_buffer.resize(old_size + to_add * SIZE_OF_TYPE)); | 59 | 51.7k | memcpy(&_buffer[old_size], vals, to_add * SIZE_OF_TYPE); | 60 | 51.7k | _count += to_add; | 61 | 51.7k | _raw_data_size += to_add * SIZE_OF_TYPE; | 62 | | | 63 | 51.7k | *count = to_add; | 64 | 51.7k | _remain_element_capacity -= to_add; | 65 | 51.7k | return Status::OK(); | 66 | 51.7k | } |
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 | 144k | Status finish(OwnedSlice* slice) override { |
69 | 144k | encode_fixed32_le((uint8_t*)&_buffer[0], cast_set<uint32_t>(_count)); |
70 | 144k | RETURN_IF_CATCH_EXCEPTION({ *slice = _buffer.build(); }); |
71 | 144k | return Status::OK(); |
72 | 144k | } _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE6finishEPNS_10OwnedSliceE Line | Count | Source | 68 | 37.9k | Status finish(OwnedSlice* slice) override { | 69 | 37.9k | encode_fixed32_le((uint8_t*)&_buffer[0], cast_set<uint32_t>(_count)); | 70 | 37.9k | RETURN_IF_CATCH_EXCEPTION({ *slice = _buffer.build(); }); | 71 | 37.9k | return Status::OK(); | 72 | 37.9k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE6finishEPNS_10OwnedSliceE Line | Count | Source | 68 | 8.54k | Status finish(OwnedSlice* slice) override { | 69 | 8.54k | encode_fixed32_le((uint8_t*)&_buffer[0], cast_set<uint32_t>(_count)); | 70 | 8.54k | RETURN_IF_CATCH_EXCEPTION({ *slice = _buffer.build(); }); | 71 | 8.54k | return Status::OK(); | 72 | 8.54k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE6finishEPNS_10OwnedSliceE Line | Count | Source | 68 | 44.6k | Status finish(OwnedSlice* slice) override { | 69 | 44.6k | encode_fixed32_le((uint8_t*)&_buffer[0], cast_set<uint32_t>(_count)); | 70 | 44.6k | RETURN_IF_CATCH_EXCEPTION({ *slice = _buffer.build(); }); | 71 | 44.6k | return Status::OK(); | 72 | 44.6k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE6finishEPNS_10OwnedSliceE Line | Count | Source | 68 | 41.3k | Status finish(OwnedSlice* slice) override { | 69 | 41.3k | encode_fixed32_le((uint8_t*)&_buffer[0], cast_set<uint32_t>(_count)); | 70 | 41.3k | RETURN_IF_CATCH_EXCEPTION({ *slice = _buffer.build(); }); | 71 | 41.3k | return Status::OK(); | 72 | 41.3k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE6finishEPNS_10OwnedSliceE Line | Count | Source | 68 | 11.5k | Status finish(OwnedSlice* slice) override { | 69 | 11.5k | encode_fixed32_le((uint8_t*)&_buffer[0], cast_set<uint32_t>(_count)); | 70 | 11.5k | RETURN_IF_CATCH_EXCEPTION({ *slice = _buffer.build(); }); | 71 | 11.5k | return Status::OK(); | 72 | 11.5k | } |
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 | 286k | Status reset() override { |
75 | 286k | RETURN_IF_CATCH_EXCEPTION({ |
76 | 286k | _buffer.reserve(_options.data_page_size); |
77 | 286k | _count = 0; |
78 | 286k | _raw_data_size = 0; |
79 | 286k | _buffer.clear(); |
80 | 286k | _buffer.resize(PLAIN_PAGE_HEADER_SIZE); |
81 | 286k | _remain_element_capacity = _options.data_page_size / SIZE_OF_TYPE; |
82 | 286k | }); |
83 | 287k | return Status::OK(); |
84 | 286k | } _ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE5resetEv Line | Count | Source | 74 | 76.4k | Status reset() override { | 75 | 76.4k | RETURN_IF_CATCH_EXCEPTION({ | 76 | 76.4k | _buffer.reserve(_options.data_page_size); | 77 | 76.4k | _count = 0; | 78 | 76.4k | _raw_data_size = 0; | 79 | 76.4k | _buffer.clear(); | 80 | 76.4k | _buffer.resize(PLAIN_PAGE_HEADER_SIZE); | 81 | 76.4k | _remain_element_capacity = _options.data_page_size / SIZE_OF_TYPE; | 82 | 76.4k | }); | 83 | 76.4k | return Status::OK(); | 84 | 76.4k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE5resetEv Line | Count | Source | 74 | 17.4k | Status reset() override { | 75 | 17.4k | RETURN_IF_CATCH_EXCEPTION({ | 76 | 17.4k | _buffer.reserve(_options.data_page_size); | 77 | 17.4k | _count = 0; | 78 | 17.4k | _raw_data_size = 0; | 79 | 17.4k | _buffer.clear(); | 80 | 17.4k | _buffer.resize(PLAIN_PAGE_HEADER_SIZE); | 81 | 17.4k | _remain_element_capacity = _options.data_page_size / SIZE_OF_TYPE; | 82 | 17.4k | }); | 83 | 17.4k | return Status::OK(); | 84 | 17.4k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE5resetEv Line | Count | Source | 74 | 88.4k | Status reset() override { | 75 | 88.4k | RETURN_IF_CATCH_EXCEPTION({ | 76 | 88.4k | _buffer.reserve(_options.data_page_size); | 77 | 88.4k | _count = 0; | 78 | 88.4k | _raw_data_size = 0; | 79 | 88.4k | _buffer.clear(); | 80 | 88.4k | _buffer.resize(PLAIN_PAGE_HEADER_SIZE); | 81 | 88.4k | _remain_element_capacity = _options.data_page_size / SIZE_OF_TYPE; | 82 | 88.4k | }); | 83 | 88.7k | return Status::OK(); | 84 | 88.4k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE5resetEv Line | Count | Source | 74 | 81.4k | Status reset() override { | 75 | 81.4k | RETURN_IF_CATCH_EXCEPTION({ | 76 | 81.4k | _buffer.reserve(_options.data_page_size); | 77 | 81.4k | _count = 0; | 78 | 81.4k | _raw_data_size = 0; | 79 | 81.4k | _buffer.clear(); | 80 | 81.4k | _buffer.resize(PLAIN_PAGE_HEADER_SIZE); | 81 | 81.4k | _remain_element_capacity = _options.data_page_size / SIZE_OF_TYPE; | 82 | 81.4k | }); | 83 | 81.5k | return Status::OK(); | 84 | 81.4k | } |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE5resetEv Line | Count | Source | 74 | 23.1k | Status reset() override { | 75 | 23.1k | RETURN_IF_CATCH_EXCEPTION({ | 76 | 23.1k | _buffer.reserve(_options.data_page_size); | 77 | 23.1k | _count = 0; | 78 | 23.1k | _raw_data_size = 0; | 79 | 23.1k | _buffer.clear(); | 80 | 23.1k | _buffer.resize(PLAIN_PAGE_HEADER_SIZE); | 81 | 23.1k | _remain_element_capacity = _options.data_page_size / SIZE_OF_TYPE; | 82 | 23.1k | }); | 83 | 23.1k | return Status::OK(); | 84 | 23.1k | } |
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 | 12.4k | uint64_t size() const override { return _buffer.size(); }_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE4sizeEv Line | Count | Source | 88 | 2.41k | uint64_t size() const override { return _buffer.size(); } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE4sizeEv Line | Count | Source | 88 | 1.12k | uint64_t size() const override { return _buffer.size(); } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE4sizeEv Line | Count | Source | 88 | 4.24k | uint64_t size() const override { return _buffer.size(); } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE4sizeEv Line | Count | Source | 88 | 2.88k | uint64_t size() const override { return _buffer.size(); } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE4sizeEv Line | Count | Source | 88 | 1.73k | 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 | 144k | uint64_t get_raw_data_size() const override { return _raw_data_size; }_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EE17get_raw_data_sizeEv Line | Count | Source | 90 | 37.9k | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EE17get_raw_data_sizeEv Line | Count | Source | 90 | 8.54k | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EE17get_raw_data_sizeEv Line | Count | Source | 90 | 44.6k | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EE17get_raw_data_sizeEv Line | Count | Source | 90 | 41.3k | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EE17get_raw_data_sizeEv Line | Count | Source | 90 | 11.5k | 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 | 142k | PlainPageBuilder(const PageBuilderOptions& options) : _options(options) {}_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE1EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 93 | 38.4k | PlainPageBuilder(const PageBuilderOptions& options) : _options(options) {} |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE3EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 93 | 8.87k | PlainPageBuilder(const PageBuilderOptions& options) : _options(options) {} |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE5EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 93 | 43.8k | PlainPageBuilder(const PageBuilderOptions& options) : _options(options) {} |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE7EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 93 | 40.1k | PlainPageBuilder(const PageBuilderOptions& options) : _options(options) {} |
_ZN5doris10segment_v216PlainPageBuilderILNS_9FieldTypeE9EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 93 | 11.6k | 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 | 225k | : _data(data), _options(options), _parsed(false), _num_elems(0), _cur_idx(0) {}_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 108 | 58.6k | : _data(data), _options(options), _parsed(false), _num_elems(0), _cur_idx(0) {} |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 108 | 10.7k | : _data(data), _options(options), _parsed(false), _num_elems(0), _cur_idx(0) {} |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 108 | 102k | : _data(data), _options(options), _parsed(false), _num_elems(0), _cur_idx(0) {} |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 108 | 38.3k | : _data(data), _options(options), _parsed(false), _num_elems(0), _cur_idx(0) {} |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 108 | 15.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 | 224k | Status init() override { |
111 | 224k | CHECK(!_parsed); |
112 | | |
113 | 224k | 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 | 224k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[0]); |
121 | | |
122 | 224k | 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 | 224k | _parsed = true; |
127 | | |
128 | 224k | RETURN_IF_ERROR(seek_to_position_in_page(0)); |
129 | 224k | return Status::OK(); |
130 | 224k | } _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EE4initEv Line | Count | Source | 110 | 58.6k | Status init() override { | 111 | 58.6k | CHECK(!_parsed); | 112 | | | 113 | 58.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 | 58.6k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[0]); | 121 | | | 122 | 58.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 | 58.6k | _parsed = true; | 127 | | | 128 | 58.6k | RETURN_IF_ERROR(seek_to_position_in_page(0)); | 129 | 58.6k | return Status::OK(); | 130 | 58.6k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EE4initEv Line | Count | Source | 110 | 10.6k | Status init() override { | 111 | 10.6k | CHECK(!_parsed); | 112 | | | 113 | 10.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 | 10.6k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[0]); | 121 | | | 122 | 10.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 | 10.6k | _parsed = true; | 127 | | | 128 | 10.6k | RETURN_IF_ERROR(seek_to_position_in_page(0)); | 129 | 10.6k | return Status::OK(); | 130 | 10.6k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EE4initEv Line | Count | Source | 110 | 101k | Status init() override { | 111 | 101k | CHECK(!_parsed); | 112 | | | 113 | 101k | 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 | 101k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[0]); | 121 | | | 122 | 101k | 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 | 101k | _parsed = true; | 127 | | | 128 | 101k | RETURN_IF_ERROR(seek_to_position_in_page(0)); | 129 | 101k | return Status::OK(); | 130 | 101k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EE4initEv Line | Count | Source | 110 | 38.2k | Status init() override { | 111 | 38.2k | CHECK(!_parsed); | 112 | | | 113 | 38.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 | 38.2k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[0]); | 121 | | | 122 | 38.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 | 38.2k | _parsed = true; | 127 | | | 128 | 38.2k | RETURN_IF_ERROR(seek_to_position_in_page(0)); | 129 | 38.2k | return Status::OK(); | 130 | 38.2k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EE4initEv Line | Count | Source | 110 | 15.3k | Status init() override { | 111 | 15.3k | CHECK(!_parsed); | 112 | | | 113 | 15.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 | 15.3k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[0]); | 121 | | | 122 | 15.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 | 15.3k | _parsed = true; | 127 | | | 128 | 15.3k | RETURN_IF_ERROR(seek_to_position_in_page(0)); | 129 | 15.3k | return Status::OK(); | 130 | 15.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 | 552k | Status seek_to_position_in_page(size_t pos) override { |
133 | 18.4E | CHECK(_parsed) << "Must call init()"; |
134 | 552k | if (_num_elems == 0) [[unlikely]] { |
135 | 6.12k | 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 | 6.12k | } |
140 | | |
141 | 552k | DCHECK_LE(pos, _num_elems); |
142 | | |
143 | 552k | _cur_idx = cast_set<uint32_t>(pos); |
144 | 552k | return Status::OK(); |
145 | 552k | } _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EE24seek_to_position_in_pageEm Line | Count | Source | 132 | 101k | Status seek_to_position_in_page(size_t pos) override { | 133 | 18.4E | CHECK(_parsed) << "Must call init()"; | 134 | 101k | if (_num_elems == 0) [[unlikely]] { | 135 | 585 | 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 | 585 | } | 140 | | | 141 | 101k | DCHECK_LE(pos, _num_elems); | 142 | | | 143 | 101k | _cur_idx = cast_set<uint32_t>(pos); | 144 | 101k | return Status::OK(); | 145 | 101k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EE24seek_to_position_in_pageEm Line | Count | Source | 132 | 13.3k | Status seek_to_position_in_page(size_t pos) override { | 133 | 18.4E | CHECK(_parsed) << "Must call init()"; | 134 | 13.3k | if (_num_elems == 0) [[unlikely]] { | 135 | 149 | 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 | 149 | } | 140 | | | 141 | 13.3k | DCHECK_LE(pos, _num_elems); | 142 | | | 143 | 13.3k | _cur_idx = cast_set<uint32_t>(pos); | 144 | 13.3k | return Status::OK(); | 145 | 13.3k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EE24seek_to_position_in_pageEm Line | Count | Source | 132 | 350k | Status seek_to_position_in_page(size_t pos) override { | 133 | 18.4E | CHECK(_parsed) << "Must call init()"; | 134 | 350k | if (_num_elems == 0) [[unlikely]] { | 135 | 3.00k | 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.00k | } | 140 | | | 141 | 350k | DCHECK_LE(pos, _num_elems); | 142 | | | 143 | 350k | _cur_idx = cast_set<uint32_t>(pos); | 144 | 350k | return Status::OK(); | 145 | 350k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EE24seek_to_position_in_pageEm Line | Count | Source | 132 | 68.1k | Status seek_to_position_in_page(size_t pos) override { | 133 | 18.4E | CHECK(_parsed) << "Must call init()"; | 134 | 68.1k | if (_num_elems == 0) [[unlikely]] { | 135 | 2.01k | 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.01k | } | 140 | | | 141 | 68.1k | DCHECK_LE(pos, _num_elems); | 142 | | | 143 | 68.1k | _cur_idx = cast_set<uint32_t>(pos); | 144 | 68.1k | return Status::OK(); | 145 | 68.1k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EE24seek_to_position_in_pageEm Line | Count | Source | 132 | 19.4k | Status seek_to_position_in_page(size_t pos) override { | 133 | 18.4E | CHECK(_parsed) << "Must call init()"; | 134 | 19.4k | if (_num_elems == 0) [[unlikely]] { | 135 | 374 | 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 | 374 | } | 140 | | | 141 | 19.4k | DCHECK_LE(pos, _num_elems); | 142 | | | 143 | 19.4k | _cur_idx = cast_set<uint32_t>(pos); | 144 | 19.4k | return Status::OK(); | 145 | 19.4k | } |
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 | 507k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { |
186 | 507k | DCHECK(_parsed); |
187 | 507k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { |
188 | 0 | return Status::OK(); |
189 | 0 | } |
190 | | |
191 | 507k | size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); |
192 | 507k | const void* src_data = &_data[PLAIN_PAGE_HEADER_SIZE + _cur_idx * SIZE_OF_TYPE]; |
193 | | |
194 | 507k | dst->insert_many_fix_len_data((const char*)src_data, max_fetch); |
195 | | |
196 | 507k | *n = max_fetch; |
197 | 507k | _cur_idx += max_fetch; |
198 | | |
199 | 507k | return Status::OK(); |
200 | 507k | } _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 185 | 96.6k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 186 | 96.6k | DCHECK(_parsed); | 187 | 96.6k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 188 | 0 | return Status::OK(); | 189 | 0 | } | 190 | | | 191 | 96.6k | size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 192 | 96.6k | const void* src_data = &_data[PLAIN_PAGE_HEADER_SIZE + _cur_idx * SIZE_OF_TYPE]; | 193 | | | 194 | 96.6k | dst->insert_many_fix_len_data((const char*)src_data, max_fetch); | 195 | | | 196 | 96.6k | *n = max_fetch; | 197 | 96.6k | _cur_idx += max_fetch; | 198 | | | 199 | 96.6k | return Status::OK(); | 200 | 96.6k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 185 | 11.7k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 186 | 11.7k | DCHECK(_parsed); | 187 | 11.7k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 188 | 0 | return Status::OK(); | 189 | 0 | } | 190 | | | 191 | 11.7k | size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 192 | 11.7k | const void* src_data = &_data[PLAIN_PAGE_HEADER_SIZE + _cur_idx * SIZE_OF_TYPE]; | 193 | | | 194 | 11.7k | dst->insert_many_fix_len_data((const char*)src_data, max_fetch); | 195 | | | 196 | 11.7k | *n = max_fetch; | 197 | 11.7k | _cur_idx += max_fetch; | 198 | | | 199 | 11.7k | return Status::OK(); | 200 | 11.7k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 185 | 316k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 186 | 316k | DCHECK(_parsed); | 187 | 316k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 188 | 0 | return Status::OK(); | 189 | 0 | } | 190 | | | 191 | 316k | size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 192 | 316k | const void* src_data = &_data[PLAIN_PAGE_HEADER_SIZE + _cur_idx * SIZE_OF_TYPE]; | 193 | | | 194 | 316k | dst->insert_many_fix_len_data((const char*)src_data, max_fetch); | 195 | | | 196 | 316k | *n = max_fetch; | 197 | 316k | _cur_idx += max_fetch; | 198 | | | 199 | 316k | return Status::OK(); | 200 | 316k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 185 | 51.0k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 186 | 51.0k | DCHECK(_parsed); | 187 | 51.0k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 188 | 0 | return Status::OK(); | 189 | 0 | } | 190 | | | 191 | 51.0k | size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 192 | 51.0k | const void* src_data = &_data[PLAIN_PAGE_HEADER_SIZE + _cur_idx * SIZE_OF_TYPE]; | 193 | | | 194 | 51.0k | dst->insert_many_fix_len_data((const char*)src_data, max_fetch); | 195 | | | 196 | 51.0k | *n = max_fetch; | 197 | 51.0k | _cur_idx += max_fetch; | 198 | | | 199 | 51.0k | return Status::OK(); | 200 | 51.0k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 185 | 31.9k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 186 | 31.9k | DCHECK(_parsed); | 187 | 31.9k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 188 | 0 | return Status::OK(); | 189 | 0 | } | 190 | | | 191 | 31.9k | size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 192 | 31.9k | const void* src_data = &_data[PLAIN_PAGE_HEADER_SIZE + _cur_idx * SIZE_OF_TYPE]; | 193 | | | 194 | 31.9k | dst->insert_many_fix_len_data((const char*)src_data, max_fetch); | 195 | | | 196 | 31.9k | *n = max_fetch; | 197 | 31.9k | _cur_idx += max_fetch; | 198 | | | 199 | 31.9k | return Status::OK(); | 200 | 31.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 | 93.1k | MutableColumnPtr& dst) override { |
204 | 93.1k | DCHECK(_parsed); |
205 | 93.1k | if (*n == 0) [[unlikely]] { |
206 | 0 | return Status::OK(); |
207 | 0 | } |
208 | | |
209 | 93.1k | auto total = *n; |
210 | 93.1k | auto read_count = 0; |
211 | 93.1k | _buffer.resize(total); |
212 | 8.86M | for (size_t i = 0; i < total; ++i) { |
213 | 8.76M | ordinal_t ord = rowids[i] - page_first_ordinal; |
214 | 8.76M | if (UNLIKELY(ord >= _num_elems)) { |
215 | 81 | break; |
216 | 81 | } |
217 | | |
218 | 8.76M | _buffer[read_count++] = |
219 | 8.76M | unaligned_load<CppType>(&_data[PLAIN_PAGE_HEADER_SIZE + ord * SIZE_OF_TYPE]); |
220 | 8.76M | } |
221 | | |
222 | 93.1k | if (LIKELY(read_count > 0)) { |
223 | 93.1k | dst->insert_many_fix_len_data((char*)_buffer.data(), read_count); |
224 | 93.1k | } |
225 | | |
226 | 93.1k | *n = read_count; |
227 | 93.1k | return Status::OK(); |
228 | 93.1k | } _ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 203 | 14.9k | MutableColumnPtr& dst) override { | 204 | 14.9k | DCHECK(_parsed); | 205 | 14.9k | if (*n == 0) [[unlikely]] { | 206 | 0 | return Status::OK(); | 207 | 0 | } | 208 | | | 209 | 14.9k | auto total = *n; | 210 | 14.9k | auto read_count = 0; | 211 | 14.9k | _buffer.resize(total); | 212 | 55.6k | for (size_t i = 0; i < total; ++i) { | 213 | 40.6k | ordinal_t ord = rowids[i] - page_first_ordinal; | 214 | 40.6k | if (UNLIKELY(ord >= _num_elems)) { | 215 | 0 | break; | 216 | 0 | } | 217 | | | 218 | 40.6k | _buffer[read_count++] = | 219 | 40.6k | unaligned_load<CppType>(&_data[PLAIN_PAGE_HEADER_SIZE + ord * SIZE_OF_TYPE]); | 220 | 40.6k | } | 221 | | | 222 | 14.9k | if (LIKELY(read_count > 0)) { | 223 | 14.9k | dst->insert_many_fix_len_data((char*)_buffer.data(), read_count); | 224 | 14.9k | } | 225 | | | 226 | 14.9k | *n = read_count; | 227 | 14.9k | return Status::OK(); | 228 | 14.9k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 203 | 4.78k | MutableColumnPtr& dst) override { | 204 | 4.78k | DCHECK(_parsed); | 205 | 4.78k | if (*n == 0) [[unlikely]] { | 206 | 0 | return Status::OK(); | 207 | 0 | } | 208 | | | 209 | 4.78k | auto total = *n; | 210 | 4.78k | auto read_count = 0; | 211 | 4.78k | _buffer.resize(total); | 212 | 41.1k | for (size_t i = 0; i < total; ++i) { | 213 | 36.3k | ordinal_t ord = rowids[i] - page_first_ordinal; | 214 | 36.3k | if (UNLIKELY(ord >= _num_elems)) { | 215 | 0 | break; | 216 | 0 | } | 217 | | | 218 | 36.3k | _buffer[read_count++] = | 219 | 36.3k | unaligned_load<CppType>(&_data[PLAIN_PAGE_HEADER_SIZE + ord * SIZE_OF_TYPE]); | 220 | 36.3k | } | 221 | | | 222 | 4.78k | if (LIKELY(read_count > 0)) { | 223 | 4.78k | dst->insert_many_fix_len_data((char*)_buffer.data(), read_count); | 224 | 4.78k | } | 225 | | | 226 | 4.78k | *n = read_count; | 227 | 4.78k | return Status::OK(); | 228 | 4.78k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 203 | 45.9k | MutableColumnPtr& dst) override { | 204 | 45.9k | DCHECK(_parsed); | 205 | 45.9k | if (*n == 0) [[unlikely]] { | 206 | 0 | return Status::OK(); | 207 | 0 | } | 208 | | | 209 | 45.9k | auto total = *n; | 210 | 45.9k | auto read_count = 0; | 211 | 45.9k | _buffer.resize(total); | 212 | 7.61M | for (size_t i = 0; i < total; ++i) { | 213 | 7.56M | ordinal_t ord = rowids[i] - page_first_ordinal; | 214 | 7.56M | if (UNLIKELY(ord >= _num_elems)) { | 215 | 0 | break; | 216 | 0 | } | 217 | | | 218 | 7.56M | _buffer[read_count++] = | 219 | 7.56M | unaligned_load<CppType>(&_data[PLAIN_PAGE_HEADER_SIZE + ord * SIZE_OF_TYPE]); | 220 | 7.56M | } | 221 | | | 222 | 45.9k | if (LIKELY(read_count > 0)) { | 223 | 45.9k | dst->insert_many_fix_len_data((char*)_buffer.data(), read_count); | 224 | 45.9k | } | 225 | | | 226 | 45.9k | *n = read_count; | 227 | 45.9k | return Status::OK(); | 228 | 45.9k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 203 | 20.4k | MutableColumnPtr& dst) override { | 204 | 20.4k | DCHECK(_parsed); | 205 | 20.4k | if (*n == 0) [[unlikely]] { | 206 | 0 | return Status::OK(); | 207 | 0 | } | 208 | | | 209 | 20.4k | auto total = *n; | 210 | 20.4k | auto read_count = 0; | 211 | 20.4k | _buffer.resize(total); | 212 | 1.13M | for (size_t i = 0; i < total; ++i) { | 213 | 1.11M | ordinal_t ord = rowids[i] - page_first_ordinal; | 214 | 1.11M | if (UNLIKELY(ord >= _num_elems)) { | 215 | 81 | break; | 216 | 81 | } | 217 | | | 218 | 1.11M | _buffer[read_count++] = | 219 | 1.11M | unaligned_load<CppType>(&_data[PLAIN_PAGE_HEADER_SIZE + ord * SIZE_OF_TYPE]); | 220 | 1.11M | } | 221 | | | 222 | 20.4k | if (LIKELY(read_count > 0)) { | 223 | 20.4k | dst->insert_many_fix_len_data((char*)_buffer.data(), read_count); | 224 | 20.4k | } | 225 | | | 226 | 20.4k | *n = read_count; | 227 | 20.4k | return Status::OK(); | 228 | 20.4k | } |
_ZN5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 203 | 6.93k | MutableColumnPtr& dst) override { | 204 | 6.93k | DCHECK(_parsed); | 205 | 6.93k | if (*n == 0) [[unlikely]] { | 206 | 0 | return Status::OK(); | 207 | 0 | } | 208 | | | 209 | 6.93k | auto total = *n; | 210 | 6.93k | auto read_count = 0; | 211 | 6.93k | _buffer.resize(total); | 212 | 16.0k | for (size_t i = 0; i < total; ++i) { | 213 | 9.12k | ordinal_t ord = rowids[i] - page_first_ordinal; | 214 | 9.12k | if (UNLIKELY(ord >= _num_elems)) { | 215 | 0 | break; | 216 | 0 | } | 217 | | | 218 | 9.12k | _buffer[read_count++] = | 219 | 9.12k | unaligned_load<CppType>(&_data[PLAIN_PAGE_HEADER_SIZE + ord * SIZE_OF_TYPE]); | 220 | 9.12k | } | 221 | | | 222 | 6.93k | if (LIKELY(read_count > 0)) { | 223 | 6.93k | dst->insert_many_fix_len_data((char*)_buffer.data(), read_count); | 224 | 6.93k | } | 225 | | | 226 | 6.93k | *n = read_count; | 227 | 6.93k | return Status::OK(); | 228 | 6.93k | } |
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 | 46.4k | size_t current_index() const override { |
236 | | DCHECK(_parsed); |
237 | 46.4k | return _cur_idx; |
238 | 46.4k | } _ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE1EE13current_indexEv Line | Count | Source | 235 | 389 | size_t current_index() const override { | 236 | | DCHECK(_parsed); | 237 | 389 | return _cur_idx; | 238 | 389 | } |
_ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE3EE13current_indexEv Line | Count | Source | 235 | 172 | size_t current_index() const override { | 236 | | DCHECK(_parsed); | 237 | 172 | return _cur_idx; | 238 | 172 | } |
_ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE5EE13current_indexEv Line | Count | Source | 235 | 42.4k | size_t current_index() const override { | 236 | | DCHECK(_parsed); | 237 | 42.4k | return _cur_idx; | 238 | 42.4k | } |
_ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE7EE13current_indexEv Line | Count | Source | 235 | 3.11k | size_t current_index() const override { | 236 | | DCHECK(_parsed); | 237 | 3.11k | return _cur_idx; | 238 | 3.11k | } |
_ZNK5doris10segment_v216PlainPageDecoderILNS_9FieldTypeE9EE13current_indexEv Line | Count | Source | 235 | 283 | size_t current_index() const override { | 236 | | DCHECK(_parsed); | 237 | 283 | return _cur_idx; | 238 | 283 | } |
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 |