Coverage Report

Created: 2025-07-23 20:08

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/root/doris/be/src/common/status.h
Line
Count
Source
1
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file. See the AUTHORS file for names of contributors.
4
5
#pragma once
6
7
#include <fmt/format.h>
8
#include <gen_cpp/Status_types.h> // for TStatus
9
#include <gen_cpp/types.pb.h>
10
#include <glog/logging.h>
11
12
#include <cstdint>
13
#include <iostream>
14
#include <memory>
15
#include <string>
16
#include <string_view>
17
#include <utility>
18
19
#include "common/compiler_util.h" // IWYU pragma: keep
20
#include "common/config.h"
21
#include "common/expected.h"
22
#include "util/stack_util.h"
23
24
namespace doris {
25
26
namespace io {
27
struct ObjectStorageStatus;
28
}
29
30
class Status;
31
32
extern io::ObjectStorageStatus convert_to_obj_response(Status st);
33
34
class PStatus;
35
36
namespace ErrorCode {
37
38
// E thrift_error_name, print_stacktrace
39
#define APPLY_FOR_THRIFT_ERROR_CODES(TStatusError)        \
40
    TStatusError(PUBLISH_TIMEOUT, false);                 \
41
    TStatusError(MEM_ALLOC_FAILED, true);                 \
42
    TStatusError(BUFFER_ALLOCATION_FAILED, true);         \
43
    TStatusError(INVALID_ARGUMENT, false);                \
44
    TStatusError(INVALID_JSON_PATH, false);               \
45
    TStatusError(MINIMUM_RESERVATION_UNAVAILABLE, true);  \
46
    TStatusError(CORRUPTION, true);                       \
47
    TStatusError(IO_ERROR, true);                         \
48
    TStatusError(NOT_FOUND, true);                        \
49
    TStatusError(ALREADY_EXIST, true);                    \
50
    TStatusError(DIRECTORY_NOT_EMPTY, true);              \
51
    TStatusError(NOT_IMPLEMENTED_ERROR, false);           \
52
    TStatusError(END_OF_FILE, false);                     \
53
    TStatusError(INTERNAL_ERROR, true);                   \
54
    TStatusError(RUNTIME_ERROR, true);                    \
55
    TStatusError(CANCELLED, false);                       \
56
    TStatusError(ANALYSIS_ERROR, false);                  \
57
    TStatusError(MEM_LIMIT_EXCEEDED, false);              \
58
    TStatusError(THRIFT_RPC_ERROR, true);                 \
59
    TStatusError(TIMEOUT, true);                          \
60
    TStatusError(LIMIT_REACH, false);                     \
61
    TStatusError(TOO_MANY_TASKS, true);                   \
62
    TStatusError(UNINITIALIZED, false);                   \
63
    TStatusError(INCOMPLETE, false);                      \
64
    TStatusError(OLAP_ERR_VERSION_ALREADY_MERGED, false); \
65
    TStatusError(ABORTED, false);                         \
66
    TStatusError(DATA_QUALITY_ERROR, false);              \
67
    TStatusError(LABEL_ALREADY_EXISTS, true);             \
68
    TStatusError(NOT_AUTHORIZED, true);                   \
69
    TStatusError(BINLOG_DISABLE, false);                  \
70
    TStatusError(BINLOG_TOO_OLD_COMMIT_SEQ, false);       \
71
    TStatusError(BINLOG_TOO_NEW_COMMIT_SEQ, false);       \
72
    TStatusError(BINLOG_NOT_FOUND_DB, false);             \
73
    TStatusError(BINLOG_NOT_FOUND_TABLE, false);          \
74
    TStatusError(NETWORK_ERROR, false);                   \
75
    TStatusError(ILLEGAL_STATE, false);                   \
76
    TStatusError(SNAPSHOT_NOT_EXIST, true);               \
77
    TStatusError(HTTP_ERROR, true);                       \
78
    TStatusError(TABLET_MISSING, true);                   \
79
    TStatusError(NOT_MASTER, true);                       \
80
    TStatusError(OBTAIN_LOCK_FAILED, false);              \
81
    TStatusError(SNAPSHOT_EXPIRED, false);                \
82
    TStatusError(DELETE_BITMAP_LOCK_ERROR, false);
83
// E error_name, error_code, print_stacktrace
84
#define APPLY_FOR_OLAP_ERROR_CODES(E)                        \
85
    E(OK, 0, false);                                         \
86
    E(CALL_SEQUENCE_ERROR, -202, true);                      \
87
    E(BUFFER_OVERFLOW, -204, true);                          \
88
    E(CONFIG_ERROR, -205, true);                             \
89
    E(INIT_FAILED, -206, true);                              \
90
    E(INVALID_SCHEMA, -207, true);                           \
91
    E(CHECKSUM_ERROR, -208, true);                           \
92
    E(SIGNATURE_ERROR, -209, true);                          \
93
    E(CATCH_EXCEPTION, -210, true);                          \
94
    E(PARSE_PROTOBUF_ERROR, -211, true);                     \
95
    E(SERIALIZE_PROTOBUF_ERROR, -212, true);                 \
96
    E(WRITE_PROTOBUF_ERROR, -213, true);                     \
97
    E(VERSION_NOT_EXIST, -214, false);                       \
98
    E(TABLE_NOT_FOUND, -215, true);                          \
99
    E(TRY_LOCK_FAILED, -216, false);                         \
100
    E(EXCEEDED_LIMIT, -217, false);                          \
101
    E(OUT_OF_BOUND, -218, false);                            \
102
    E(INVALID_ROOT_PATH, -222, true);                        \
103
    E(NO_AVAILABLE_ROOT_PATH, -223, true);                   \
104
    E(CHECK_LINES_ERROR, -224, true);                        \
105
    E(INVALID_CLUSTER_INFO, -225, true);                     \
106
    E(TRANSACTION_NOT_EXIST, -226, false);                   \
107
    E(DISK_FAILURE, -227, true);                             \
108
    E(TRANSACTION_ALREADY_COMMITTED, -228, false);           \
109
    E(TRANSACTION_ALREADY_VISIBLE, -229, false);             \
110
    E(VERSION_ALREADY_MERGED, -230, true);                   \
111
    E(LZO_DISABLED, -231, true);                             \
112
    E(DISK_REACH_CAPACITY_LIMIT, -232, true);                \
113
    E(TOO_MANY_TRANSACTIONS, -233, false);                   \
114
    E(INVALID_SNAPSHOT_VERSION, -234, true);                 \
115
    E(TOO_MANY_VERSION, -235, false);                        \
116
    E(NOT_INITIALIZED, -236, true);                          \
117
    E(ALREADY_CANCELLED, -237, false);                       \
118
    E(TOO_MANY_SEGMENTS, -238, false);                       \
119
    E(ALREADY_CLOSED, -239, false);                          \
120
    E(SERVICE_UNAVAILABLE, -240, true);                      \
121
    E(NEED_SEND_AGAIN, -241, false);                         \
122
    E(OS_ERROR, -242, true);                                 \
123
    E(DIR_NOT_EXIST, -243, true);                            \
124
    E(CREATE_FILE_ERROR, -245, true);                        \
125
    E(STL_ERROR, -246, true);                                \
126
    E(MUTEX_ERROR, -247, true);                              \
127
    E(PTHREAD_ERROR, -248, true);                            \
128
    E(UB_FUNC_ERROR, -250, true);                            \
129
    E(COMPRESS_ERROR, -251, true);                           \
130
    E(DECOMPRESS_ERROR, -252, true);                         \
131
    E(FILE_ALREADY_EXIST, -253, true);                       \
132
    E(BAD_CAST, -254, true);                                 \
133
    E(ARITHMETIC_OVERFLOW_ERRROR, -255, false);              \
134
    E(PERMISSION_DENIED, -256, false);                       \
135
    E(QUERY_MEMORY_EXCEEDED, -257, false);                   \
136
    E(WORKLOAD_GROUP_MEMORY_EXCEEDED, -258, false);          \
137
    E(PROCESS_MEMORY_EXCEEDED, -259, false);                 \
138
    E(INVALID_INPUT_SYNTAX, -260, false);                    \
139
    E(CE_CMD_PARAMS_ERROR, -300, true);                      \
140
    E(CE_BUFFER_TOO_SMALL, -301, true);                      \
141
    E(CE_CMD_NOT_VALID, -302, true);                         \
142
    E(CE_LOAD_TABLE_ERROR, -303, true);                      \
143
    E(CE_NOT_FINISHED, -304, true);                          \
144
    E(CE_TABLET_ID_EXIST, -305, true);                       \
145
    E(TABLE_VERSION_DUPLICATE_ERROR, -400, true);            \
146
    E(TABLE_VERSION_INDEX_MISMATCH_ERROR, -401, true);       \
147
    E(TABLE_INDEX_VALIDATE_ERROR, -402, true);               \
148
    E(TABLE_INDEX_FIND_ERROR, -403, true);                   \
149
    E(TABLE_CREATE_FROM_HEADER_ERROR, -404, true);           \
150
    E(TABLE_CREATE_META_ERROR, -405, true);                  \
151
    E(TABLE_ALREADY_DELETED_ERROR, -406, false);             \
152
    E(ENGINE_INSERT_EXISTS_TABLE, -500, true);               \
153
    E(ENGINE_DROP_NOEXISTS_TABLE, -501, true);               \
154
    E(ENGINE_LOAD_INDEX_TABLE_ERROR, -502, true);            \
155
    E(TABLE_INSERT_DUPLICATION_ERROR, -503, true);           \
156
    E(DELETE_VERSION_ERROR, -504, true);                     \
157
    E(GC_SCAN_PATH_ERROR, -505, true);                       \
158
    E(ENGINE_INSERT_OLD_TABLET, -506, true);                 \
159
    E(FETCH_OTHER_ERROR, -600, true);                        \
160
    E(FETCH_TABLE_NOT_EXIST, -601, true);                    \
161
    E(FETCH_VERSION_ERROR, -602, true);                      \
162
    E(FETCH_SCHEMA_ERROR, -603, true);                       \
163
    E(FETCH_COMPRESSION_ERROR, -604, true);                  \
164
    E(FETCH_CONTEXT_NOT_EXIST, -605, true);                  \
165
    E(FETCH_GET_READER_PARAMS_ERR, -606, true);              \
166
    E(FETCH_SAVE_SESSION_ERR, -607, true);                   \
167
    E(FETCH_MEMORY_EXCEEDED, -608, true);                    \
168
    E(READER_IS_UNINITIALIZED, -700, true);                  \
169
    E(READER_GET_ITERATOR_ERROR, -701, true);                \
170
    E(CAPTURE_ROWSET_READER_ERROR, -702, true);              \
171
    E(READER_READING_ERROR, -703, true);                     \
172
    E(READER_INITIALIZE_ERROR, -704, true);                  \
173
    E(BE_VERSION_NOT_MATCH, -800, true);                     \
174
    E(BE_REPLACE_VERSIONS_ERROR, -801, true);                \
175
    E(BE_MERGE_ERROR, -802, true);                           \
176
    E(CAPTURE_ROWSET_ERROR, -804, true);                     \
177
    E(BE_SAVE_HEADER_ERROR, -805, true);                     \
178
    E(BE_INIT_OLAP_DATA, -806, true);                        \
179
    E(BE_TRY_OBTAIN_VERSION_LOCKS, -807, true);              \
180
    E(BE_NO_SUITABLE_VERSION, -808, false);                  \
181
    E(BE_INVALID_NEED_MERGED_VERSIONS, -810, true);          \
182
    E(BE_ERROR_DELETE_ACTION, -811, true);                   \
183
    E(BE_SEGMENTS_OVERLAPPING, -812, true);                  \
184
    E(PUSH_INIT_ERROR, -900, true);                          \
185
    E(PUSH_VERSION_INCORRECT, -902, true);                   \
186
    E(PUSH_SCHEMA_MISMATCH, -903, true);                     \
187
    E(PUSH_CHECKSUM_ERROR, -904, true);                      \
188
    E(PUSH_ACQUIRE_DATASOURCE_ERROR, -905, true);            \
189
    E(PUSH_CREAT_CUMULATIVE_ERROR, -906, true);              \
190
    E(PUSH_BUILD_DELTA_ERROR, -907, true);                   \
191
    E(PUSH_VERSION_ALREADY_EXIST, -908, false);              \
192
    E(PUSH_TABLE_NOT_EXIST, -909, true);                     \
193
    E(PUSH_INPUT_DATA_ERROR, -910, true);                    \
194
    E(PUSH_TRANSACTION_ALREADY_EXIST, -911, false);          \
195
    E(PUSH_BATCH_PROCESS_REMOVED, -912, true);               \
196
    E(PUSH_COMMIT_ROWSET, -913, true);                       \
197
    E(PUSH_ROWSET_NOT_FOUND, -914, true);                    \
198
    E(INDEX_LOAD_ERROR, -1000, true);                        \
199
    E(INDEX_CHECKSUM_ERROR, -1002, true);                    \
200
    E(INDEX_DELTA_PRUNING, -1003, true);                     \
201
    E(DATA_ROW_BLOCK_ERROR, -1100, true);                    \
202
    E(DATA_FILE_TYPE_ERROR, -1101, true);                    \
203
    E(WRITER_INDEX_WRITE_ERROR, -1200, true);                \
204
    E(WRITER_DATA_WRITE_ERROR, -1201, true);                 \
205
    E(WRITER_ROW_BLOCK_ERROR, -1202, true);                  \
206
    E(WRITER_SEGMENT_NOT_FINALIZED, -1203, true);            \
207
    E(ROWBLOCK_DECOMPRESS_ERROR, -1300, true);               \
208
    E(ROWBLOCK_FIND_ROW_EXCEPTION, -1301, true);             \
209
    E(HEADER_ADD_VERSION, -1400, true);                      \
210
    E(HEADER_DELETE_VERSION, -1401, true);                   \
211
    E(HEADER_ADD_PENDING_DELTA, -1402, true);                \
212
    E(HEADER_ADD_INCREMENTAL_VERSION, -1403, true);          \
213
    E(HEADER_INVALID_FLAG, -1404, true);                     \
214
    E(HEADER_LOAD_INVALID_KEY, -1408, true);                 \
215
    E(HEADER_LOAD_JSON_HEADER, -1410, true);                 \
216
    E(HEADER_INIT_FAILED, -1411, true);                      \
217
    E(HEADER_PB_PARSE_FAILED, -1412, true);                  \
218
    E(HEADER_HAS_PENDING_DATA, -1413, true);                 \
219
    E(SCHEMA_SCHEMA_INVALID, -1500, true);                   \
220
    E(SCHEMA_SCHEMA_FIELD_INVALID, -1501, true);             \
221
    E(ALTER_MULTI_TABLE_ERR, -1600, true);                   \
222
    E(ALTER_DELTA_DOES_NOT_EXISTS, -1601, true);             \
223
    E(ALTER_STATUS_ERR, -1602, true);                        \
224
    E(PREVIOUS_SCHEMA_CHANGE_NOT_FINISHED, -1603, true);     \
225
    E(SCHEMA_CHANGE_INFO_INVALID, -1604, true);              \
226
    E(QUERY_SPLIT_KEY_ERR, -1605, true);                     \
227
    E(DATA_QUALITY_ERR, -1606, false);                       \
228
    E(COLUMN_DATA_LOAD_BLOCK, -1700, true);                  \
229
    E(COLUMN_DATA_RECORD_INDEX, -1701, true);                \
230
    E(COLUMN_DATA_MAKE_FILE_HEADER, -1702, true);            \
231
    E(COLUMN_DATA_READ_VAR_INT, -1703, true);                \
232
    E(COLUMN_DATA_PATCH_LIST_NUM, -1704, true);              \
233
    E(COLUMN_READ_STREAM, -1706, true);                      \
234
    E(COLUMN_STREAM_NOT_EXIST, -1716, true);                 \
235
    E(COLUMN_VALUE_NULL, -1717, true);                       \
236
    E(COLUMN_SEEK_ERROR, -1719, true);                       \
237
    E(COLUMN_NO_MATCH_OFFSETS_SIZE, -1720, true);            \
238
    E(COLUMN_NO_MATCH_FILTER_SIZE, -1721, true);             \
239
    E(DELETE_INVALID_CONDITION, -1900, true);                \
240
    E(DELETE_UPDATE_HEADER_FAILED, -1901, true);             \
241
    E(DELETE_SAVE_HEADER_FAILED, -1902, true);               \
242
    E(DELETE_INVALID_PARAMETERS, -1903, true);               \
243
    E(DELETE_INVALID_VERSION, -1904, true);                  \
244
    E(CUMULATIVE_NO_SUITABLE_VERSION, -2000, false);         \
245
    E(CUMULATIVE_REPEAT_INIT, -2001, true);                  \
246
    E(CUMULATIVE_INVALID_PARAMETERS, -2002, true);           \
247
    E(CUMULATIVE_FAILED_ACQUIRE_DATA_SOURCE, -2003, true);   \
248
    E(CUMULATIVE_INVALID_NEED_MERGED_VERSIONS, -2004, true); \
249
    E(CUMULATIVE_ERROR_DELETE_ACTION, -2005, true);          \
250
    E(CUMULATIVE_MISS_VERSION, -2006, true);                 \
251
    E(FULL_NO_SUITABLE_VERSION, -2008, false);               \
252
    E(FULL_MISS_VERSION, -2009, true);                       \
253
    E(CUMULATIVE_MEET_DELETE_VERSION, -2010, false);         \
254
    E(META_INVALID_ARGUMENT, -3000, true);                   \
255
    E(META_OPEN_DB_ERROR, -3001, true);                      \
256
    E(META_KEY_NOT_FOUND, -3002, false);                     \
257
    E(META_GET_ERROR, -3003, true);                          \
258
    E(META_PUT_ERROR, -3004, true);                          \
259
    E(META_ITERATOR_ERROR, -3005, true);                     \
260
    E(META_DELETE_ERROR, -3006, true);                       \
261
    E(META_ALREADY_EXIST, -3007, true);                      \
262
    E(ROWSET_WRITER_INIT, -3100, true);                      \
263
    E(ROWSET_SAVE_FAILED, -3101, true);                      \
264
    E(ROWSET_GENERATE_ID_FAILED, -3102, true);               \
265
    E(ROWSET_DELETE_FILE_FAILED, -3103, true);               \
266
    E(ROWSET_BUILDER_INIT, -3104, true);                     \
267
    E(ROWSET_TYPE_NOT_FOUND, -3105, true);                   \
268
    E(ROWSET_ALREADY_EXIST, -3106, true);                    \
269
    E(ROWSET_CREATE_READER, -3107, true);                    \
270
    E(ROWSET_INVALID, -3108, true);                          \
271
    E(ROWSET_READER_INIT, -3110, true);                      \
272
    E(ROWSET_INVALID_STATE_TRANSITION, -3112, true);         \
273
    E(STRING_OVERFLOW_IN_VEC_ENGINE, -3113, true);           \
274
    E(ROWSET_ADD_MIGRATION_V2, -3114, true);                 \
275
    E(PUBLISH_VERSION_NOT_CONTINUOUS, -3115, false);         \
276
    E(ROWSET_RENAME_FILE_FAILED, -3116, false);              \
277
    E(SEGCOMPACTION_INIT_READER, -3117, false);              \
278
    E(SEGCOMPACTION_INIT_WRITER, -3118, false);              \
279
    E(SEGCOMPACTION_FAILED, -3119, false);                   \
280
    E(ROWSET_ADD_TO_BINLOG_FAILED, -3122, true);             \
281
    E(ROWSET_BINLOG_NOT_ONLY_ONE_VERSION, -3123, true);      \
282
    E(INDEX_INVALID_PARAMETERS, -6000, false);               \
283
    E(INVERTED_INDEX_NOT_SUPPORTED, -6001, false);           \
284
    E(INVERTED_INDEX_CLUCENE_ERROR, -6002, false);           \
285
    E(INVERTED_INDEX_FILE_NOT_FOUND, -6003, false);          \
286
    E(INVERTED_INDEX_BYPASS, -6004, false);                  \
287
    E(INVERTED_INDEX_NO_TERMS, -6005, false);                \
288
    E(INVERTED_INDEX_RENAME_FILE_FAILED, -6006, true);       \
289
    E(INVERTED_INDEX_EVALUATE_SKIPPED, -6007, false);        \
290
    E(INVERTED_INDEX_BUILD_WAITTING, -6008, false);          \
291
    E(INVERTED_INDEX_NOT_IMPLEMENTED, -6009, false);         \
292
    E(INVERTED_INDEX_COMPACTION_ERROR, -6010, false);        \
293
    E(INVERTED_INDEX_ANALYZER_ERROR, -6011, false);          \
294
    E(INVERTED_INDEX_FILE_CORRUPTED, -6012, false);          \
295
    E(KEY_NOT_FOUND, -7000, false);                          \
296
    E(KEY_ALREADY_EXISTS, -7001, false);                     \
297
    E(ENTRY_NOT_FOUND, -7002, false);                        \
298
    E(NEW_ROWS_IN_PARTIAL_UPDATE, -7003, false);             \
299
    E(INVALID_TABLET_STATE, -7211, false);                   \
300
    E(ROWSETS_EXPIRED, -7311, false);                        \
301
    E(CGROUP_ERROR, -7411, false);                           \
302
    E(FATAL_ERROR, -7412, false);
303
304
// Define constexpr int error_code_name = error_code_value
305
#define M(NAME, ERRORCODE, ENABLESTACKTRACE) constexpr int NAME = ERRORCODE;
306
APPLY_FOR_OLAP_ERROR_CODES(M)
307
#undef M
308
309
#define MM(name, ENABLESTACKTRACE) constexpr int name = TStatusCode::name;
310
APPLY_FOR_THRIFT_ERROR_CODES(MM)
311
#undef MM
312
313
constexpr int MAX_ERROR_CODE_DEFINE_NUM = 65536;
314
struct ErrorCodeState {
315
    int16_t error_code = 0;
316
    bool stacktrace = true;
317
    std::string description;
318
    size_t count = 0; // Used for count the number of error happens
319
    std::mutex mutex; // lock guard for count state
320
};
321
extern ErrorCodeState error_states[MAX_ERROR_CODE_DEFINE_NUM];
322
323
class ErrorCodeInitializer {
324
public:
325
0
    ErrorCodeInitializer(int temp) : signal_value(temp) {
326
0
        for (auto& error_state : error_states) {
327
0
            error_state.error_code = 0;
328
0
        }
329
0
#define M(NAME, ENABLESTACKTRACE)                                  \
330
0
    error_states[TStatusCode::NAME].stacktrace = ENABLESTACKTRACE; \
331
0
    error_states[TStatusCode::NAME].description = #NAME;           \
332
0
    error_states[TStatusCode::NAME].error_code = TStatusCode::NAME;
333
0
        APPLY_FOR_THRIFT_ERROR_CODES(M)
334
0
#undef M
335
0
// In status.h, if error code > 0, then it means it will be used in TStatusCode and will
336
0
// also be used in FE.
337
0
// Other error codes that with error code < 0, will only be used in BE.
338
0
// We use abs(error code) as the index in error_states, so that these two kinds of error
339
0
// codes MUST not have overlap.
340
0
// Add an assert here to make sure the code in TStatusCode and other error code are not
341
0
// overlapped.
342
0
#define M(NAME, ERRORCODE, ENABLESTACKTRACE)                    \
343
0
    assert(error_states[abs(ERRORCODE)].error_code == 0);       \
344
0
    error_states[abs(ERRORCODE)].stacktrace = ENABLESTACKTRACE; \
345
0
    error_states[abs(ERRORCODE)].error_code = ERRORCODE;
346
0
        APPLY_FOR_OLAP_ERROR_CODES(M)
347
0
#undef M
348
0
    }
349
350
1
    void check_init() const {
351
        //the signal value is 0, it means the global error states not inited, it's logical error
352
        // DO NOT use dcheck here, because dcheck depend on glog, and glog maybe not inited at this time.
353
1
        if (signal_value == 0) {
354
0
            exit(-1);
355
0
        }
356
1
    }
357
358
private:
359
    int signal_value = 0;
360
};
361
362
extern ErrorCodeInitializer error_code_init;
363
} // namespace ErrorCode
364
365
class [[nodiscard]] Status {
366
public:
367
355M
    Status() : _code(ErrorCode::OK), _err_msg(nullptr) {}
368
369
    // used to convert Exception to Status
370
27.1k
    Status(int code, std::string msg, std::string stack = "") : _code(code) {
371
27.1k
        _err_msg = std::make_unique<ErrMsg>();
372
27.1k
        _err_msg->_msg = std::move(msg);
373
27.1k
        if (config::enable_stacktrace) {
374
0
            _err_msg->_stack = std::move(stack);
375
0
        }
376
27.1k
    }
377
378
    // copy c'tor makes copy of error detail so Status can be returned by value
379
564k
    Status(const Status& rhs) { *this = rhs; }
380
381
    // move c'tor
382
1.12M
    Status(Status&& rhs) noexcept = default;
383
384
    // same as copy c'tor
385
568k
    Status& operator=(const Status& rhs) {
386
568k
        _code = rhs._code;
387
568k
        if (rhs._err_msg) {
388
765
            _err_msg = std::make_unique<ErrMsg>(*rhs._err_msg);
389
567k
        } else {
390
            // If rhs error msg is empty, then should also clear current error msg
391
            // For example, if rhs is OK and current status is error, then copy to current
392
            // status, should clear current error message.
393
567k
            _err_msg.reset();
394
567k
        }
395
568k
        return *this;
396
568k
    }
397
398
    // move assign
399
4.73M
    Status& operator=(Status&& rhs) noexcept {
400
4.73M
        _code = rhs._code;
401
4.73M
        if (rhs._err_msg) {
402
109k
            _err_msg = std::move(rhs._err_msg);
403
4.62M
        } else {
404
4.62M
            _err_msg.reset();
405
4.62M
        }
406
4.73M
        return *this;
407
4.73M
    }
408
409
    template <bool stacktrace = true>
410
    Status static create(const TStatus& status) {
411
        return Error<stacktrace>(
412
                status.status_code,
413
                "TStatus: " + (status.error_msgs.empty() ? "" : status.error_msgs[0]));
414
    }
415
416
    template <bool stacktrace = true>
417
0
    Status static create(const PStatus& pstatus) {
418
0
        return Error<stacktrace>(
419
0
                pstatus.status_code(),
420
0
                "PStatus: " + (pstatus.error_msgs_size() == 0 ? "" : pstatus.error_msgs(0)));
421
0
    }
422
423
    template <int code, bool stacktrace = true, typename... Args>
424
84.8k
    Status static Error(std::string_view msg, Args&&... args) {
425
84.8k
        Status status;
426
84.8k
        status._code = code;
427
84.8k
        status._err_msg = std::make_unique<ErrMsg>();
428
84.8k
        if constexpr (sizeof...(args) == 0) {
429
11.3k
            status._err_msg->_msg = msg;
430
73.4k
        } else {
431
73.4k
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
73.4k
        }
433
84.8k
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
84.8k
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
0
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
84.8k
        return status;
440
84.8k
    }
_ZN5doris6Status5ErrorILin257ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
3.84k
    Status static Error(std::string_view msg, Args&&... args) {
425
3.84k
        Status status;
426
3.84k
        status._code = code;
427
3.84k
        status._err_msg = std::make_unique<ErrMsg>();
428
3.84k
        if constexpr (sizeof...(args) == 0) {
429
3.84k
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
3.84k
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
3.84k
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
3.84k
        return status;
440
3.84k
    }
_ZN5doris6Status5ErrorILin258ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
1
    Status static Error(std::string_view msg, Args&&... args) {
425
1
        Status status;
426
1
        status._code = code;
427
1
        status._err_msg = std::make_unique<ErrMsg>();
428
1
        if constexpr (sizeof...(args) == 0) {
429
1
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
1
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
1
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
1
        return status;
440
1
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILin259ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJRSt17basic_string_viewIcSt11char_traitsIcEEEEES0_S5_DpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJRlEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
_ZN5doris6Status5ErrorILi6ELb0EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
60
    Status static Error(std::string_view msg, Args&&... args) {
425
60
        Status status;
426
60
        status._code = code;
427
60
        status._err_msg = std::make_unique<ErrMsg>();
428
60
        if constexpr (sizeof...(args) == 0) {
429
60
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
60
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
60
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
60
        return status;
440
60
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJRmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS6_EDpOT1_
_ZN5doris6Status5ErrorILi33ELb0EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
167
    Status static Error(std::string_view msg, Args&&... args) {
425
167
        Status status;
426
167
        status._code = code;
427
167
        status._err_msg = std::make_unique<ErrMsg>();
428
167
        if constexpr (sizeof...(args) == 0) {
429
167
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
167
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
167
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
167
        return status;
440
167
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi4ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
_ZN5doris6Status5ErrorILi5ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
17
    Status static Error(std::string_view msg, Args&&... args) {
425
17
        Status status;
426
17
        status._code = code;
427
17
        status._err_msg = std::make_unique<ErrMsg>();
428
17
        if constexpr (sizeof...(args) == 0) {
429
17
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
17
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
17
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
17
        return status;
440
17
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJRlRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_EEES0_St17basic_string_viewIcS6_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT1_
_ZN5doris6Status5ErrorILi33ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
31
    Status static Error(std::string_view msg, Args&&... args) {
425
31
        Status status;
426
31
        status._code = code;
427
31
        status._err_msg = std::make_unique<ErrMsg>();
428
31
        if constexpr (sizeof...(args) == 0) {
429
31
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
31
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
31
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
31
        return status;
440
31
    }
_ZN5doris6Status5ErrorILi32ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
2
    Status static Error(std::string_view msg, Args&&... args) {
425
2
        Status status;
426
2
        status._code = code;
427
2
        status._err_msg = std::make_unique<ErrMsg>();
428
2
        if constexpr (sizeof...(args) == 0) {
429
2
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
2
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
2
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
2
        return status;
440
2
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJRKmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEES0_St17basic_string_viewIcS5_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJPKcEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi3ELb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_S7_EEES0_St17basic_string_viewIcS5_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi33ELb0EJRmNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS6_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi33ELb0EJiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT1_
_ZN5doris6Status5ErrorILi6ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
742
    Status static Error(std::string_view msg, Args&&... args) {
425
742
        Status status;
426
742
        status._code = code;
427
742
        status._err_msg = std::make_unique<ErrMsg>();
428
742
        if constexpr (sizeof...(args) == 0) {
429
742
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
742
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
742
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
742
        return status;
440
742
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILin3112ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
_ZN5doris6Status5ErrorILi3ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
10
    Status static Error(std::string_view msg, Args&&... args) {
425
10
        Status status;
426
10
        status._code = code;
427
10
        status._err_msg = std::make_unique<ErrMsg>();
428
10
        if constexpr (sizeof...(args) == 0) {
429
10
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
10
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
10
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
10
        return status;
440
10
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi33ELb1EJRmRKtEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi33ELb1EJRmRiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin207ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
_ZN5doris6Status5ErrorILi33ELb0EJRNS_10segment_v214HashStrategyPBEEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
1
    Status static Error(std::string_view msg, Args&&... args) {
425
1
        Status status;
426
1
        status._code = code;
427
1
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
1
        } else {
431
1
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
1
        }
433
1
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
1
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
1
        return status;
440
1
    }
_ZN5doris6Status5ErrorILi33ELb0EJRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
7
    Status static Error(std::string_view msg, Args&&... args) {
425
7
        Status status;
426
7
        status._code = code;
427
7
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
7
        } else {
431
7
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
7
        }
433
7
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
7
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
7
        return status;
440
7
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi3ELb1EJRKNS_13PrimitiveTypeEEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
_ZN5doris6Status5ErrorILi6ELb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcEEES0_St17basic_string_viewIcS5_EDpOT1_
Line
Count
Source
424
1
    Status static Error(std::string_view msg, Args&&... args) {
425
1
        Status status;
426
1
        status._code = code;
427
1
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
1
        } else {
431
1
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
1
        }
433
1
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
1
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
1
        return status;
440
1
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin6009ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi33ELb0EJmRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEES0_St17basic_string_viewIcS5_EDpOT1_
_ZN5doris6Status5ErrorILi6ELb1EJRlS2_EEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
1
    Status static Error(std::string_view msg, Args&&... args) {
425
1
        Status status;
426
1
        status._code = code;
427
1
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
1
        } else {
431
1
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
1
        }
433
1
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
1
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
1
        return status;
440
1
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJR8CURLcodeEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
_ZN5doris6Status5ErrorILi34ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
16
    Status static Error(std::string_view msg, Args&&... args) {
425
16
        Status status;
426
16
        status._code = code;
427
16
        status._err_msg = std::make_unique<ErrMsg>();
428
16
        if constexpr (sizeof...(args) == 0) {
429
16
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
16
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
16
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
16
        return status;
440
16
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJRNS_19TStorageBackendType4typeEEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
_ZN5doris6Status5ErrorILi34ELb1EJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS7_S7_EEES0_St17basic_string_viewIcS5_EDpOT1_
Line
Count
Source
424
2
    Status static Error(std::string_view msg, Args&&... args) {
425
2
        Status status;
426
2
        status._code = code;
427
2
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
2
        } else {
431
2
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
2
        }
433
2
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
2
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
2
        return status;
440
2
    }
_ZN5doris6Status5ErrorILi34ELb0EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
3
    Status static Error(std::string_view msg, Args&&... args) {
425
3
        Status status;
426
3
        status._code = code;
427
3
        status._err_msg = std::make_unique<ErrMsg>();
428
3
        if constexpr (sizeof...(args) == 0) {
429
3
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
3
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
3
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
3
        return status;
440
3
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi1ELb0EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEES0_St17basic_string_viewIcS5_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi33ELb0EJNS_13PredicateTypeEEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb0EJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT1_
_ZN5doris6Status5ErrorILi6ELb1EJiRA15_KcEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
2
    Status static Error(std::string_view msg, Args&&... args) {
425
2
        Status status;
426
2
        status._code = code;
427
2
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
2
        } else {
431
2
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
2
        }
433
2
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
2
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
2
        return status;
440
2
    }
_ZN5doris6Status5ErrorILin206ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
2
    Status static Error(std::string_view msg, Args&&... args) {
425
2
        Status status;
426
2
        status._code = code;
427
2
        status._err_msg = std::make_unique<ErrMsg>();
428
2
        if constexpr (sizeof...(args) == 0) {
429
2
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
2
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
2
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
2
        return status;
440
2
    }
_ZN5doris6Status5ErrorILin3002ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
38
    Status static Error(std::string_view msg, Args&&... args) {
425
38
        Status status;
426
38
        status._code = code;
427
38
        status._err_msg = std::make_unique<ErrMsg>();
428
38
        if constexpr (sizeof...(args) == 0) {
429
38
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
38
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
38
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
38
        return status;
440
38
    }
_ZN5doris6Status5ErrorILi33ELb1EJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT1_
Line
Count
Source
424
2
    Status static Error(std::string_view msg, Args&&... args) {
425
2
        Status status;
426
2
        status._code = code;
427
2
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
2
        } else {
431
2
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
2
        }
433
2
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
2
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
2
        return status;
440
2
    }
_ZN5doris6Status5ErrorILi30ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
255
    Status static Error(std::string_view msg, Args&&... args) {
425
255
        Status status;
426
255
        status._code = code;
427
255
        status._err_msg = std::make_unique<ErrMsg>();
428
255
        if constexpr (sizeof...(args) == 0) {
429
255
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
255
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
255
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
255
        return status;
440
255
    }
_ZN5doris6Status5ErrorILin6002ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
14
    Status static Error(std::string_view msg, Args&&... args) {
425
14
        Status status;
426
14
        status._code = code;
427
14
        status._err_msg = std::make_unique<ErrMsg>();
428
14
        if constexpr (sizeof...(args) == 0) {
429
14
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
14
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
14
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
14
        return status;
440
14
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJiiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_EEES0_St17basic_string_viewIcS5_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJiiiiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin704ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
_ZN5doris6Status5ErrorILi6ELb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT1_
Line
Count
Source
424
9
    Status static Error(std::string_view msg, Args&&... args) {
425
9
        Status status;
426
9
        status._code = code;
427
9
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
9
        } else {
431
9
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
9
        }
433
9
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
9
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
9
        return status;
440
9
    }
_ZN5doris6Status5ErrorILi6ELb1EJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT1_
Line
Count
Source
424
52.0k
    Status static Error(std::string_view msg, Args&&... args) {
425
52.0k
        Status status;
426
52.0k
        status._code = code;
427
52.0k
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
52.0k
        } else {
431
52.0k
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
52.0k
        }
433
52.0k
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
52.0k
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
52.0k
        return status;
440
52.0k
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJRiS2_EEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
_ZN5doris6Status5ErrorILi36ELb0EJPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS9_lEEES0_St17basic_string_viewIcS7_EDpOT1_
Line
Count
Source
424
2
    Status static Error(std::string_view msg, Args&&... args) {
425
2
        Status status;
426
2
        status._code = code;
427
2
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
2
        } else {
431
2
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
2
        }
433
2
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
2
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
2
        return status;
440
2
    }
_ZN5doris6Status5ErrorILi30ELb0EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
6.14k
    Status static Error(std::string_view msg, Args&&... args) {
425
6.14k
        Status status;
426
6.14k
        status._code = code;
427
6.14k
        status._err_msg = std::make_unique<ErrMsg>();
428
6.14k
        if constexpr (sizeof...(args) == 0) {
429
6.14k
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
6.14k
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
6.14k
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
6.14k
        return status;
440
6.14k
    }
_ZN5doris6Status5ErrorILi39ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
6
    Status static Error(std::string_view msg, Args&&... args) {
425
6
        Status status;
426
6
        status._code = code;
427
6
        status._err_msg = std::make_unique<ErrMsg>();
428
6
        if constexpr (sizeof...(args) == 0) {
429
6
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
6
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
6
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
6
        return status;
440
6
    }
_ZN5doris6Status5ErrorILi6ELb1EJmNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_jS7_S7_EEES0_St17basic_string_viewIcS5_EDpOT1_
Line
Count
Source
424
2
    Status static Error(std::string_view msg, Args&&... args) {
425
2
        Status status;
426
2
        status._code = code;
427
2
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
2
        } else {
431
2
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
2
        }
433
2
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
2
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
2
        return status;
440
2
    }
_ZN5doris6Status5ErrorILi1ELb0EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
19
    Status static Error(std::string_view msg, Args&&... args) {
425
19
        Status status;
426
19
        status._code = code;
427
19
        status._err_msg = std::make_unique<ErrMsg>();
428
19
        if constexpr (sizeof...(args) == 0) {
429
19
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
19
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
19
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
19
        return status;
440
19
    }
_ZN5doris6Status5ErrorILi33ELb0EJRhEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
1
    Status static Error(std::string_view msg, Args&&... args) {
425
1
        Status status;
426
1
        status._code = code;
427
1
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
1
        } else {
431
1
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
1
        }
433
1
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
1
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
1
        return status;
440
1
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi33ELb0EJcRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
_ZN5doris6Status5ErrorILi4ELb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT1_
Line
Count
Source
424
17.0k
    Status static Error(std::string_view msg, Args&&... args) {
425
17.0k
        Status status;
426
17.0k
        status._code = code;
427
17.0k
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
17.0k
        } else {
431
17.0k
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
17.0k
        }
433
17.0k
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
17.0k
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
17.0k
        return status;
440
17.0k
    }
_ZN5doris6Status5ErrorILi36ELb0EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
1
    Status static Error(std::string_view msg, Args&&... args) {
425
1
        Status status;
426
1
        status._code = code;
427
1
        status._err_msg = std::make_unique<ErrMsg>();
428
1
        if constexpr (sizeof...(args) == 0) {
429
1
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
1
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
1
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
1
        return status;
440
1
    }
_ZN5doris6Status5ErrorILi6ELb1EJmhEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
268
    Status static Error(std::string_view msg, Args&&... args) {
425
268
        Status status;
426
268
        status._code = code;
427
268
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
268
        } else {
431
268
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
268
        }
433
268
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
268
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
268
        return status;
440
268
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJRSt17basic_string_viewIcSt11char_traitsIcEEEEES0_S5_DpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJRmRKiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi4ELb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEES0_St17basic_string_viewIcS5_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi33ELb0EJRiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi4ELb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERA109_KcEEES0_St17basic_string_viewIcS5_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi33ELb0EJRKiRKPKcRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi12ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi33ELb0EJRKPKcS3_EEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJRmS2_S2_EEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
_ZN5doris6Status5ErrorILi6ELb1EJPKcEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
12
    Status static Error(std::string_view msg, Args&&... args) {
425
12
        Status status;
426
12
        status._code = code;
427
12
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
12
        } else {
431
12
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
12
        }
433
12
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
12
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
12
        return status;
440
12
    }
_ZN5doris6Status5ErrorILi6ELb1EJmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
2
    Status static Error(std::string_view msg, Args&&... args) {
425
2
        Status status;
426
2
        status._code = code;
427
2
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
2
        } else {
431
2
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
2
        }
433
2
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
2
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
2
        return status;
440
2
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJRKNS_13TSerdeDialect4typeEEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJRiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmEEES0_St17basic_string_viewIcS6_EDpOT1_
_ZN5doris6Status5ErrorILi33ELb0EJRlS2_EEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
4
    Status static Error(std::string_view msg, Args&&... args) {
425
4
        Status status;
426
4
        status._code = code;
427
4
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
4
        } else {
431
4
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
4
        }
433
4
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
4
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
4
        return status;
440
4
    }
_ZN5doris6Status5ErrorILi33ELb0EJRlEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
4
    Status static Error(std::string_view msg, Args&&... args) {
425
4
        Status status;
426
4
        status._code = code;
427
4
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
4
        } else {
431
4
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
4
        }
433
4
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
4
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
4
        return status;
440
4
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi34ELb1EJmRiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi32ELb1EJRmS2_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_EEES0_St17basic_string_viewIcS6_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi32ELb1EJRjRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb0EJPKcEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
_ZN5doris6Status5ErrorILi31ELb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Line
Count
Source
424
5
    Status static Error(std::string_view msg, Args&&... args) {
425
5
        Status status;
426
5
        status._code = code;
427
5
        status._err_msg = std::make_unique<ErrMsg>();
428
5
        if constexpr (sizeof...(args) == 0) {
429
5
            status._err_msg->_msg = msg;
430
        } else {
431
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
        }
433
5
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
5
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
5
        return status;
440
5
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_EEES0_St17basic_string_viewIcS5_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_RmSA_EEES0_St17basic_string_viewIcS5_EDpOT1_
_ZN5doris6Status5ErrorILi6ELb1EJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT1_
Line
Count
Source
424
13
    Status static Error(std::string_view msg, Args&&... args) {
425
13
        Status status;
426
13
        status._code = code;
427
13
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
13
        } else {
431
13
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
13
        }
433
13
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
13
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
13
        return status;
440
13
    }
_ZN5doris6Status5ErrorILi6ELb1EJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEES0_St17basic_string_viewIcS5_EDpOT1_
Line
Count
Source
424
4.04k
    Status static Error(std::string_view msg, Args&&... args) {
425
4.04k
        Status status;
426
4.04k
        status._code = code;
427
4.04k
        status._err_msg = std::make_unique<ErrMsg>();
428
        if constexpr (sizeof...(args) == 0) {
429
            status._err_msg->_msg = msg;
430
4.04k
        } else {
431
4.04k
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
432
4.04k
        }
433
4.04k
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
434
4.04k
            config::enable_stacktrace) {
435
            // Delete the first one frame pointers, which are inside the status.h
436
0
            status._err_msg->_stack = get_stack_trace(1);
437
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
438
0
        }
439
4.04k
        return status;
440
4.04k
    }
Unexecuted instantiation: _ZN5doris6Status5ErrorILi6ELb1EJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3orc8TypeKindEEEES0_St17basic_string_viewIcS5_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi33ELb0EJRKPKcRiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILi33ELb0EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKPKcEEES0_St17basic_string_viewIcS5_EDpOT1_
Unexecuted instantiation: _ZN5doris6Status5ErrorILin7412ELb1EJRlS2_EEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT1_
441
442
    template <bool stacktrace = true, typename... Args>
443
57.5k
    Status static Error(int code, std::string_view msg, Args&&... args) {
444
57.5k
        Status status;
445
57.5k
        status._code = code;
446
57.5k
        status._err_msg = std::make_unique<ErrMsg>();
447
57.5k
        if constexpr (sizeof...(args) == 0) {
448
57.5k
            status._err_msg->_msg = msg;
449
        } else {
450
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
451
        }
452
57.5k
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
453
57.5k
            config::enable_stacktrace) {
454
0
            status._err_msg->_stack = get_stack_trace(1);
455
0
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
456
0
        }
457
57.5k
        return status;
458
57.5k
    }
_ZN5doris6Status5ErrorILb1EJEEES0_iSt17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
443
1.90k
    Status static Error(int code, std::string_view msg, Args&&... args) {
444
1.90k
        Status status;
445
1.90k
        status._code = code;
446
1.90k
        status._err_msg = std::make_unique<ErrMsg>();
447
1.90k
        if constexpr (sizeof...(args) == 0) {
448
1.90k
            status._err_msg->_msg = msg;
449
        } else {
450
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
451
        }
452
1.90k
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
453
1.90k
            config::enable_stacktrace) {
454
0
            status._err_msg->_stack = get_stack_trace(1);
455
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
456
0
        }
457
1.90k
        return status;
458
1.90k
    }
_ZN5doris6Status5ErrorILb0EJEEES0_iSt17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
443
55.6k
    Status static Error(int code, std::string_view msg, Args&&... args) {
444
55.6k
        Status status;
445
55.6k
        status._code = code;
446
55.6k
        status._err_msg = std::make_unique<ErrMsg>();
447
55.6k
        if constexpr (sizeof...(args) == 0) {
448
55.6k
            status._err_msg->_msg = msg;
449
        } else {
450
            status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...);
451
        }
452
55.6k
        if (stacktrace && ErrorCode::error_states[abs(code)].stacktrace &&
453
55.6k
            config::enable_stacktrace) {
454
0
            status._err_msg->_stack = get_stack_trace(1);
455
            LOG(WARNING) << "meet error status: " << status; // may print too many stacks.
456
0
        }
457
55.6k
        return status;
458
55.6k
    }
459
460
354M
    static Status OK() { return {}; }
461
462
    template <bool stacktrace = true, typename... Args>
463
0
    static Status FatalError(std::string_view msg, Args&&... args) {
464
0
#ifndef NDEBUG
465
0
        LOG(FATAL) << fmt::format(msg, std::forward<Args>(args)...);
466
0
#endif
467
0
        return Error<ErrorCode::FATAL_ERROR, stacktrace>(msg, std::forward<Args>(args)...);
468
0
    }
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJRSt17basic_string_viewIcSt11char_traitsIcEEEEES0_S5_DpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJRlEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJRlRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_EEES0_St17basic_string_viewIcS6_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJRKmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEES0_St17basic_string_viewIcS5_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJPKcEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_S7_EEES0_St17basic_string_viewIcS5_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJRNS_19TStorageBackendType4typeEEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status10FatalErrorILb1EJRlS2_EEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
469
470
// default have stacktrace. could disable manually.
471
#define ERROR_CTOR(name, code)                                                       \
472
    template <bool stacktrace = true, typename... Args>                              \
473
70.1k
    static Status name(std::string_view msg, Args&&... args) {                       \
474
70.1k
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
70.1k
    }
_ZN5doris6Status13InternalErrorILb0EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
59
    static Status name(std::string_view msg, Args&&... args) {                       \
474
59
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
59
    }
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJRmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS6_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status12RuntimeErrorILb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
_ZN5doris6Status19MemoryLimitExceededILb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
17
    static Status name(std::string_view msg, Args&&... args) {                       \
474
17
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
17
    }
_ZN5doris6Status10CorruptionILb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
2
    static Status name(std::string_view msg, Args&&... args) {                       \
474
2
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
2
    }
_ZN5doris6Status12NotSupportedILb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
2
    static Status name(std::string_view msg, Args&&... args) {                       \
474
2
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
2
    }
Unexecuted instantiation: _ZN5doris6Status12NotSupportedILb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT0_
_ZN5doris6Status13InternalErrorILb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
731
    static Status name(std::string_view msg, Args&&... args) {                       \
474
731
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
731
    }
Unexecuted instantiation: _ZN5doris6Status12NotSupportedILb1EJRKNS_13PrimitiveTypeEEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
_ZN5doris6Status13InternalErrorILb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcEEES0_St17basic_string_viewIcS5_EDpOT0_
Line
Count
Source
473
1
    static Status name(std::string_view msg, Args&&... args) {                       \
474
1
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
1
    }
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEES0_St17basic_string_viewIcS5_EDpOT0_
_ZN5doris6Status13InternalErrorILb1EJRlS2_EEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
1
    static Status name(std::string_view msg, Args&&... args) {                       \
474
1
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
1
    }
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJR8CURLcodeEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
_ZN5doris6Status7IOErrorILb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
16
    static Status name(std::string_view msg, Args&&... args) {                       \
474
16
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
16
    }
_ZN5doris6Status7IOErrorILb1EJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS7_S7_EEES0_St17basic_string_viewIcS5_EDpOT0_
Line
Count
Source
473
2
    static Status name(std::string_view msg, Args&&... args) {                       \
474
2
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
2
    }
_ZN5doris6Status7IOErrorILb0EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
1
    static Status name(std::string_view msg, Args&&... args) {                       \
474
1
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
1
    }
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb0EJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT0_
_ZN5doris6Status13InternalErrorILb1EJiRA15_KcEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
2
    static Status name(std::string_view msg, Args&&... args) {                       \
474
2
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
2
    }
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJiiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_EEES0_St17basic_string_viewIcS5_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJiiiiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
_ZN5doris6Status13InternalErrorILb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT0_
Line
Count
Source
473
9
    static Status name(std::string_view msg, Args&&... args) {                       \
474
9
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
9
    }
_ZN5doris6Status13InternalErrorILb1EJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT0_
Line
Count
Source
473
52.0k
    static Status name(std::string_view msg, Args&&... args) {                       \
474
52.0k
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
52.0k
    }
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJRiS2_EEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
_ZN5doris6Status7AbortedILb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
6
    static Status name(std::string_view msg, Args&&... args) {                       \
474
6
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
6
    }
_ZN5doris6Status12RuntimeErrorILb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT0_
Line
Count
Source
473
17.0k
    static Status name(std::string_view msg, Args&&... args) {                       \
474
17.0k
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
17.0k
    }
_ZN5doris6Status13InternalErrorILb1EJmhEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
268
    static Status name(std::string_view msg, Args&&... args) {                       \
474
268
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
268
    }
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJRSt17basic_string_viewIcSt11char_traitsIcEEEEES0_S5_DpOT0_
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJRmRKiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status12RuntimeErrorILb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEES0_St17basic_string_viewIcS5_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status12RuntimeErrorILb1EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERA109_KcEEES0_St17basic_string_viewIcS5_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status17BufferAllocFailedILb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJRmS2_S2_EEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
_ZN5doris6Status13InternalErrorILb1EJPKcEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
12
    static Status name(std::string_view msg, Args&&... args) {                       \
474
12
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
12
    }
_ZN5doris6Status13InternalErrorILb1EJmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
2
    static Status name(std::string_view msg, Args&&... args) {                       \
474
2
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
2
    }
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJRKNS_13TSerdeDialect4typeEEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJRiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmEEES0_St17basic_string_viewIcS6_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status7IOErrorILb1EJmRiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status10CorruptionILb1EJRmS2_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_EEES0_St17basic_string_viewIcS6_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status10CorruptionILb1EJRjRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb0EJPKcEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
_ZN5doris6Status8NotFoundILb1EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
473
2
    static Status name(std::string_view msg, Args&&... args) {                       \
474
2
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
2
    }
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_EEES0_St17basic_string_viewIcS5_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_RmSA_EEES0_St17basic_string_viewIcS5_EDpOT0_
_ZN5doris6Status13InternalErrorILb1EJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT0_
Line
Count
Source
473
13
    static Status name(std::string_view msg, Args&&... args) {                       \
474
13
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
13
    }
_ZN5doris6Status13InternalErrorILb1EJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEES0_St17basic_string_viewIcS5_EDpOT0_
Line
Count
Source
473
1
    static Status name(std::string_view msg, Args&&... args) {                       \
474
1
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
475
1
    }
Unexecuted instantiation: _ZN5doris6Status13InternalErrorILb1EJRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3orc8TypeKindEEEES0_St17basic_string_viewIcS5_EDpOT0_
476
477
// default have no stacktrace. could enable manually.
478
#define ERROR_CTOR_NOSTACK(name, code)                                               \
479
    template <bool stacktrace = false, typename... Args>                             \
480
6.35k
    static Status name(std::string_view msg, Args&&... args) {                       \
481
6.35k
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
482
6.35k
    }
_ZN5doris6Status15InvalidArgumentILb0EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
480
167
    static Status name(std::string_view msg, Args&&... args) {                       \
481
167
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
482
167
    }
Unexecuted instantiation: _ZN5doris6Status15InvalidArgumentILb0EJRmNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS6_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status15InvalidArgumentILb0EJiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEES0_St17basic_string_viewIcS5_EDpOT0_
_ZN5doris6Status15InvalidArgumentILb0EJRNS_10segment_v214HashStrategyPBEEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
480
1
    static Status name(std::string_view msg, Args&&... args) {                       \
481
1
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
482
1
    }
_ZN5doris6Status15InvalidArgumentILb0EJRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
480
7
    static Status name(std::string_view msg, Args&&... args) {                       \
481
7
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
482
7
    }
Unexecuted instantiation: _ZN5doris6Status15InvalidArgumentILb0EJmRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status9CancelledILb0EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EEES0_St17basic_string_viewIcS5_EDpOT0_
Unexecuted instantiation: _ZN5doris6Status15InvalidArgumentILb0EJNS_13PredicateTypeEEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
_ZN5doris6Status12NetworkErrorILb0EJPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS9_lEEES0_St17basic_string_viewIcS7_EDpOT0_
Line
Count
Source
480
2
    static Status name(std::string_view msg, Args&&... args) {                       \
481
2
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
482
2
    }
_ZN5doris6Status9EndOfFileILb0EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
480
6.14k
    static Status name(std::string_view msg, Args&&... args) {                       \
481
6.14k
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
482
6.14k
    }
_ZN5doris6Status9CancelledILb0EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
480
19
    static Status name(std::string_view msg, Args&&... args) {                       \
481
19
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
482
19
    }
_ZN5doris6Status15InvalidArgumentILb0EJRhEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
480
1
    static Status name(std::string_view msg, Args&&... args) {                       \
481
1
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
482
1
    }
Unexecuted instantiation: _ZN5doris6Status15InvalidArgumentILb0EJcRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
_ZN5doris6Status12NetworkErrorILb0EJEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
480
1
    static Status name(std::string_view msg, Args&&... args) {                       \
481
1
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
482
1
    }
Unexecuted instantiation: _ZN5doris6Status15InvalidArgumentILb0EJRiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status15InvalidArgumentILb0EJRKiRKPKcRmEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status15InvalidArgumentILb0EJRKPKcS3_EEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
_ZN5doris6Status15InvalidArgumentILb0EJRlS2_EEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
480
4
    static Status name(std::string_view msg, Args&&... args) {                       \
481
4
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
482
4
    }
_ZN5doris6Status15InvalidArgumentILb0EJRlEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Line
Count
Source
480
4
    static Status name(std::string_view msg, Args&&... args) {                       \
481
4
        return Error<ErrorCode::code, stacktrace>(msg, std::forward<Args>(args)...); \
482
4
    }
Unexecuted instantiation: _ZN5doris6Status15InvalidArgumentILb0EJRKPKcRiEEES0_St17basic_string_viewIcSt11char_traitsIcEEDpOT0_
Unexecuted instantiation: _ZN5doris6Status15InvalidArgumentILb0EJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKPKcEEES0_St17basic_string_viewIcS5_EDpOT0_
483
484
    ERROR_CTOR(PublishTimeout, PUBLISH_TIMEOUT)
485
    ERROR_CTOR(MemoryAllocFailed, MEM_ALLOC_FAILED)
486
    ERROR_CTOR(BufferAllocFailed, BUFFER_ALLOCATION_FAILED)
487
    ERROR_CTOR_NOSTACK(InvalidArgument, INVALID_ARGUMENT)
488
    ERROR_CTOR_NOSTACK(InvalidJsonPath, INVALID_JSON_PATH)
489
    ERROR_CTOR(MinimumReservationUnavailable, MINIMUM_RESERVATION_UNAVAILABLE)
490
    ERROR_CTOR(Corruption, CORRUPTION)
491
    ERROR_CTOR(IOError, IO_ERROR)
492
    ERROR_CTOR(NotFound, NOT_FOUND)
493
    ERROR_CTOR_NOSTACK(AlreadyExist, ALREADY_EXIST)
494
    ERROR_CTOR_NOSTACK(DirectoryNotEmpty, DIRECTORY_NOT_EMPTY)
495
    ERROR_CTOR(NotSupported, NOT_IMPLEMENTED_ERROR)
496
    ERROR_CTOR_NOSTACK(EndOfFile, END_OF_FILE)
497
    ERROR_CTOR(InternalError, INTERNAL_ERROR)
498
    ERROR_CTOR(RuntimeError, RUNTIME_ERROR)
499
    ERROR_CTOR_NOSTACK(Cancelled, CANCELLED)
500
    ERROR_CTOR(MemoryLimitExceeded, MEM_LIMIT_EXCEEDED)
501
    ERROR_CTOR(RpcError, THRIFT_RPC_ERROR)
502
    ERROR_CTOR_NOSTACK(TimedOut, TIMEOUT)
503
    ERROR_CTOR_NOSTACK(TooManyTasks, TOO_MANY_TASKS)
504
    ERROR_CTOR(Uninitialized, UNINITIALIZED)
505
    ERROR_CTOR(Aborted, ABORTED)
506
    ERROR_CTOR_NOSTACK(DataQualityError, DATA_QUALITY_ERROR)
507
    ERROR_CTOR_NOSTACK(NotAuthorized, NOT_AUTHORIZED)
508
    ERROR_CTOR(HttpError, HTTP_ERROR)
509
    ERROR_CTOR_NOSTACK(NeedSendAgain, NEED_SEND_AGAIN)
510
    ERROR_CTOR_NOSTACK(CgroupError, CGROUP_ERROR)
511
    ERROR_CTOR_NOSTACK(ObtainLockFailed, OBTAIN_LOCK_FAILED)
512
    ERROR_CTOR_NOSTACK(NetworkError, NETWORK_ERROR)
513
#undef ERROR_CTOR
514
515
    template <int code>
516
810k
    bool is() const {
517
810k
        return code == _code;
518
810k
    }
_ZNK5doris6Status2isILin7002EEEbv
Line
Count
Source
516
6.02k
    bool is() const {
517
6.02k
        return code == _code;
518
6.02k
    }
_ZNK5doris6Status2isILi30EEEbv
Line
Count
Source
516
801k
    bool is() const {
517
801k
        return code == _code;
518
801k
    }
_ZNK5doris6Status2isILi6EEEbv
Line
Count
Source
516
4
    bool is() const {
517
4
        return code == _code;
518
4
    }
_ZNK5doris6Status2isILin206EEEbv
Line
Count
Source
516
1
    bool is() const {
517
1
        return code == _code;
518
1
    }
_ZNK5doris6Status2isILin228EEEbv
Line
Count
Source
516
1
    bool is() const {
517
1
        return code == _code;
518
1
    }
_ZNK5doris6Status2isILi33EEEbv
Line
Count
Source
516
218
    bool is() const {
517
218
        return code == _code;
518
218
    }
_ZNK5doris6Status2isILi39EEEbv
Line
Count
Source
516
1
    bool is() const {
517
1
        return code == _code;
518
1
    }
_ZNK5doris6Status2isILin240EEEbv
Line
Count
Source
516
3.50k
    bool is() const {
517
3.50k
        return code == _code;
518
3.50k
    }
519
520
0
    void set_code(int code) { _code = code; }
521
522
349M
    bool ok() const { return _code == ErrorCode::OK; }
523
524
    // Convert into TStatus.
525
    void to_thrift(TStatus* status) const;
526
    TStatus to_thrift() const;
527
    void to_protobuf(PStatus* status) const;
528
529
    std::string to_string() const;
530
    std::string to_string_no_stack() const;
531
532
    /// @return A json representation of this status.
533
    std::string to_json() const;
534
535
63.8k
    int code() const { return _code; }
536
537
    /// Clone this status and add the specified prefix to the message.
538
    ///
539
    /// If this status is OK, then an OK status will be returned.
540
    ///
541
    /// @param [in] msg
542
    ///   The message to prepend.
543
    /// @return A ref to Status object
544
    Status& prepend(std::string_view msg);
545
546
    /// Add the specified suffix to the message.
547
    ///
548
    /// If this status is OK, then an OK status will be returned.
549
    ///
550
    /// @param [in] msg
551
    ///   The message to append.
552
    /// @return A ref to Status object
553
    Status& append(std::string_view msg);
554
555
    // if(!status) or if (status) will use this operator
556
77.3M
    operator bool() const { return this->ok(); }
557
558
    // Used like if ASSERT_EQ(res, Status::OK())
559
    // if the state is ok, then both code and precise code is not initialized properly, so that should check ok state
560
    // ignore error messages during comparison
561
301k
    bool operator==(const Status& st) const { return _code == st._code; }
562
563
    // Used like if ASSERT_NE(res, Status::OK())
564
1.25M
    bool operator!=(const Status& st) const { return _code != st._code; }
565
566
    friend std::ostream& operator<<(std::ostream& ostr, const Status& status);
567
568
59.5k
    std::string_view msg() const { return _err_msg ? _err_msg->_msg : std::string_view(""); }
569
570
0
    std::pair<int, std::string> retrieve_error_msg() { return {_code, std::move(_err_msg->_msg)}; }
571
572
    friend io::ObjectStorageStatus convert_to_obj_response(Status st);
573
574
private:
575
    int _code;
576
    struct ErrMsg {
577
        std::string _msg;
578
        std::string _stack;
579
    };
580
    std::unique_ptr<ErrMsg> _err_msg;
581
582
6.37k
    std::string code_as_string() const {
583
6.37k
        return (int)_code >= 0 ? doris::to_string(static_cast<TStatusCode::type>(_code))
584
6.37k
                               : fmt::format("E{}", (int16_t)_code);
585
6.37k
    }
586
};
587
588
// There are many thread using status to indicate the cancel state, one thread may update it and
589
// the other thread will read it. Status is not thread safe, for example, if one thread is update it
590
// and another thread is call to_string method, it may core, because the _err_msg is an unique ptr and
591
// it is deconstructed during copy method.
592
// And also we could not use lock, because we need get status frequently to check if it is cancelled.
593
// The default value is ok.
594
class AtomicStatus {
595
public:
596
1.70M
    AtomicStatus() : error_st_(Status::OK()) {}
597
598
2.74M
    bool ok() const { return error_code_.load(std::memory_order_acquire) == 0; }
599
600
107
    bool update(const Status& new_status) {
601
        // If new status is normal, or the old status is abnormal, then not need update
602
107
        if (new_status.ok() || error_code_.load(std::memory_order_acquire) != 0) {
603
66
            return false;
604
66
        }
605
41
        std::lock_guard l(mutex_);
606
41
        if (error_code_.load(std::memory_order_acquire) != 0) {
607
0
            return false;
608
0
        }
609
41
        error_st_ = new_status;
610
41
        error_code_.store(static_cast<int16_t>(new_status.code()), std::memory_order_release);
611
41
        return true;
612
41
    }
613
614
0
    void reset() {
615
0
        std::lock_guard l(mutex_);
616
0
        error_st_ = Status::OK();
617
0
        error_code_ = 0;
618
0
    }
619
620
    // will copy a new status object to avoid concurrency
621
    // This stauts could only be called when ok==false
622
624
    Status status() const {
623
624
        std::lock_guard l(mutex_);
624
624
        return error_st_;
625
624
    }
626
627
    AtomicStatus(const AtomicStatus&) = delete;
628
    void operator=(const AtomicStatus&) = delete;
629
630
private:
631
    std::atomic_int16_t error_code_ = 0;
632
    Status error_st_;
633
    // mutex's lock is not a const method, but we will use this mutex in
634
    // some const method, so that it should be mutable.
635
    mutable std::mutex mutex_;
636
};
637
638
6.23k
inline std::ostream& operator<<(std::ostream& ostr, const Status& status) {
639
6.23k
    ostr << '[' << status.code_as_string() << ']';
640
6.23k
    ostr << status.msg();
641
6.23k
    if (status._err_msg && !status._err_msg->_stack.empty() && config::enable_stacktrace) {
642
0
        ostr << '\n' << status._err_msg->_stack;
643
0
    }
644
6.23k
    return ostr;
645
6.23k
}
646
647
6.12k
inline std::string Status::to_string() const {
648
6.12k
    std::stringstream ss;
649
6.12k
    ss << *this;
650
6.12k
    return ss.str();
651
6.12k
}
652
653
0
inline std::string Status::to_string_no_stack() const {
654
0
    return fmt::format("[{}]{}", code_as_string(), msg());
655
0
}
656
657
// some generally useful macros
658
#define RETURN_IF_ERROR(stmt)           \
659
1.12M
    do {                                \
660
1.12M
        Status _status_ = (stmt);       \
661
1.12M
        if (UNLIKELY(!_status_.ok())) { \
662
896
            return _status_;            \
663
896
        }                               \
664
1.12M
    } while (false)
665
666
#define PROPAGATE_FALSE(stmt)                     \
667
    do {                                          \
668
        if (UNLIKELY(!static_cast<bool>(stmt))) { \
669
            return false;                         \
670
        }                                         \
671
    } while (false)
672
673
#define THROW_IF_ERROR(stmt)            \
674
227
    do {                                \
675
227
        Status _status_ = (stmt);       \
676
227
        if (UNLIKELY(!_status_.ok())) { \
677
0
            throw Exception(_status_);  \
678
0
        }                               \
679
227
    } while (false)
680
681
#define RETURN_IF_STATUS_ERROR(status, stmt) \
682
    do {                                     \
683
        status = (stmt);                     \
684
        if (UNLIKELY(!status.ok())) {        \
685
            return;                          \
686
        }                                    \
687
    } while (false)
688
689
#define EXIT_IF_ERROR(stmt)             \
690
    do {                                \
691
        Status _status_ = (stmt);       \
692
        if (UNLIKELY(!_status_.ok())) { \
693
            LOG(ERROR) << _status_;     \
694
            exit(1);                    \
695
        }                               \
696
    } while (false)
697
698
#define RETURN_FALSE_IF_ERROR(stmt)   \
699
    do {                              \
700
        Status status = (stmt);       \
701
        if (UNLIKELY(!status.ok())) { \
702
            return false;             \
703
        }                             \
704
    } while (false)
705
706
/// @brief Emit a warning if @c to_call returns a bad status.
707
#define WARN_IF_ERROR(to_call, warning_prefix)              \
708
34
    do {                                                    \
709
34
        Status _s = (to_call);                              \
710
34
        if (UNLIKELY(!_s.ok())) {                           \
711
0
            LOG(WARNING) << (warning_prefix) << ": " << _s; \
712
0
        }                                                   \
713
34
    } while (false);
714
715
#define RETURN_NOT_OK_STATUS_WITH_WARN(stmt, warning_prefix)       \
716
    do {                                                           \
717
        Status _s = (stmt);                                        \
718
        if (UNLIKELY(!_s.ok())) {                                  \
719
            LOG(WARNING) << (warning_prefix) << ", error: " << _s; \
720
            return _s;                                             \
721
        }                                                          \
722
    } while (false);
723
724
template <typename T>
725
using Result = expected<T, Status>;
726
727
using ResultError = unexpected<Status>;
728
729
#define RETURN_IF_ERROR_RESULT(stmt)                \
730
    do {                                            \
731
        Status _status_ = (stmt);                   \
732
        if (UNLIKELY(!_status_.ok())) {             \
733
            return unexpected(std::move(_status_)); \
734
        }                                           \
735
    } while (false)
736
737
#define DORIS_TRY(stmt)                          \
738
32
    ({                                           \
739
32
        auto&& res = (stmt);                     \
740
32
        using T = std::decay_t<decltype(res)>;   \
741
32
        if (!res.has_value()) [[unlikely]] {     \
742
0
            return std::forward<T>(res).error(); \
743
0
        }                                        \
744
32
        std::forward<T>(res).value();            \
745
32
    });
746
747
#define TEST_TRY(stmt)                                                                          \
748
20
    ({                                                                                          \
749
3.14k
        auto&& res = (stmt);                                                                    \
time_sharing_task_executor_test.cpp:_ZZN5doris10vectorized52TimeSharingTaskExecutorTest_test_tasks_complete_Test8TestBodyEvENK3$_0clEv
Line
Count
Source
749
33
        auto&& res = (stmt);                                                                    \
time_sharing_task_executor_test.cpp:_ZZN5doris10vectorized53TimeSharingTaskExecutorTest_test_quanta_fairness_Test8TestBodyEvENK3$_0clEv
Line
Count
Source
749
9
        auto&& res = (stmt);                                                                    \
time_sharing_task_executor_test.cpp:_ZZN5doris10vectorized53TimeSharingTaskExecutorTest_test_quanta_fairness_Test8TestBodyEvENK3$_1clEv
Line
Count
Source
749
4
        auto&& res = (stmt);                                                                    \
time_sharing_task_executor_test.cpp:_ZZN5doris10vectorized52TimeSharingTaskExecutorTest_test_level_movement_Test8TestBodyEvENK3$_0clEv
Line
Count
Source
749
1.20k
        auto&& res = (stmt);                                                                    \
time_sharing_task_executor_test.cpp:_ZZN5doris10vectorized55TimeSharingTaskExecutorTest_test_level_multipliers_Test8TestBodyEvENK3$_0clEv
Line
Count
Source
749
616
        auto&& res = (stmt);                                                                    \
time_sharing_task_executor_test.cpp:_ZZN5doris10vectorized55TimeSharingTaskExecutorTest_test_level_multipliers_Test8TestBodyEvENK3$_1clEv
Line
Count
Source
749
616
        auto&& res = (stmt);                                                                    \
time_sharing_task_executor_test.cpp:_ZZN5doris10vectorized55TimeSharingTaskExecutorTest_test_level_multipliers_Test8TestBodyEvENK3$_2clEv
Line
Count
Source
749
616
        auto&& res = (stmt);                                                                    \
time_sharing_task_executor_test.cpp:_ZZN5doris10vectorized49TimeSharingTaskExecutorTest_test_task_handle_Test8TestBodyEvENK3$_0clEv
Line
Count
Source
749
22
        auto&& res = (stmt);                                                                    \
time_sharing_task_executor_test.cpp:_ZZN5doris10vectorized66TimeSharingTaskExecutorTest_test_min_max_concurrency_per_task_Test8TestBodyEvENK3$_0clEv
Line
Count
Source
749
16
        auto&& res = (stmt);                                                                    \
time_sharing_task_executor_test.cpp:_ZZN5doris10vectorized79TimeSharingTaskExecutorTest_test_user_specified_max_concurrencies_per_task_Test8TestBodyEvENK3$_0clEv
Line
Count
Source
749
8
        auto&& res = (stmt);                                                                    \
time_sharing_task_executor_test.cpp:_ZZN5doris10vectorized96TimeSharingTaskExecutorTest_test_min_concurrency_per_task_when_target_concurrency_increases_Test8TestBodyEvENK3$_0clEv
Line
Count
Source
749
6
        auto&& res = (stmt);                                                                    \
750
20
        using T = std::decay_t<decltype(res)>;                                                  \
751
20
        if (!res.has_value()) [[unlikely]] {                                                    \
752
0
            ASSERT_TRUE(res.has_value()) << "Expected success, but got error: " << res.error(); \
753
0
        }                                                                                       \
754
20
        std::forward<T>(res).value();                                                           \
755
20
    })
756
757
} // namespace doris
758
759
// specify formatter for Status
760
template <>
761
struct fmt::formatter<doris::Status> {
762
    template <typename ParseContext>
763
13
    constexpr auto parse(ParseContext& ctx) {
764
13
        return ctx.begin();
765
13
    }
766
767
    template <typename FormatContext>
768
13
    auto format(doris::Status const& status, FormatContext& ctx) {
769
13
        return fmt::format_to(ctx.out(), "{}", status.to_string());
770
13
    }
771
};