diff --git a/src/common/default_values.cppm b/src/common/default_values.cppm index 8f9c95dbeb..5223d16b5a 100644 --- a/src/common/default_values.cppm +++ b/src/common/default_values.cppm @@ -89,17 +89,17 @@ export { constexpr SizeT MIN_CLEANUP_INTERVAL_SEC = 0; // 0 means disable the function constexpr SizeT DEFAULT_CLEANUP_INTERVAL_SEC = 10; - constexpr String DEFAULT_CLEANUP_INTERVAL_SEC_STR = "10s"; // 10 seconds + constexpr std::string_view DEFAULT_CLEANUP_INTERVAL_SEC_STR = "10s"; // 10 seconds constexpr SizeT MAX_CLEANUP_INTERVAL_SEC = 60 * 60 * 24 * 30; // 1 month constexpr SizeT MIN_COMPACT_INTERVAL_SEC = 0; // 0 means disable the function constexpr SizeT DEFAULT_COMPACT_INTERVAL_SEC = 10; - constexpr String DEFAULT_COMPACT_INTERVAL_SEC_STR = "10s"; // 10 seconds + constexpr std::string_view DEFAULT_COMPACT_INTERVAL_SEC_STR = "10s"; // 10 seconds constexpr SizeT MAX_COMPACT_INTERVAL_SEC = 60 * 60 * 24 * 30; // 1 month constexpr SizeT MIN_OPTIMIZE_INTERVAL_SEC = 1; constexpr SizeT DEFAULT_OPTIMIZE_INTERVAL_SEC = 10; - constexpr String DEFAULT_OPTIMIZE_INTERVAL_SEC_STR = "10s"; // 10 seconds + constexpr std::string_view DEFAULT_OPTIMIZE_INTERVAL_SEC_STR = "10s"; // 10 seconds constexpr SizeT MAX_OPTIMIZE_INTERVAL_SEC = 60 * 60 * 24 * 30; // 1 month constexpr SizeT MIN_MEMINDEX_CAPACITY = DEFAULT_BLOCK_CAPACITY; // 1 Block @@ -108,22 +108,22 @@ export { constexpr i64 MIN_WAL_FILE_SIZE_THRESHOLD = 1024; // 1KB constexpr i64 DEFAULT_WAL_FILE_SIZE_THRESHOLD = 1 * 1024l * 1024l * 1024l; // 1GB - constexpr String DEFAULT_WAL_FILE_SIZE_THRESHOLD_STR = "1GB"; // 1GB + constexpr std::string_view DEFAULT_WAL_FILE_SIZE_THRESHOLD_STR = "1GB"; // 1GB constexpr i64 MAX_WAL_FILE_SIZE_THRESHOLD = 1024l * DEFAULT_WAL_FILE_SIZE_THRESHOLD; // 1TB constexpr i64 MIN_FULL_CHECKPOINT_INTERVAL_SEC = 0; // 0 means disable full checkpoint constexpr i64 DEFAULT_FULL_CHECKPOINT_INTERVAL_SEC = 30; // 30 seconds - constexpr String DEFAULT_FULL_CHECKPOINT_INTERVAL_SEC_STR = "30s"; // 30 seconds + constexpr std::string_view DEFAULT_FULL_CHECKPOINT_INTERVAL_SEC_STR = "30s"; // 30 seconds constexpr i64 MAX_FULL_CHECKPOINT_INTERVAL_SEC = 60 * 60 * 24 * 30; // 1 month constexpr i64 MIN_DELTA_CHECKPOINT_INTERVAL_SEC = 0; // 0 means disable delta checkpoint constexpr i64 DEFAULT_DELTA_CHECKPOINT_INTERVAL_SEC = 5; // 5 seconds - constexpr String DEFAULT_DELTA_CHECKPOINT_INTERVAL_SEC_STR = "5s"; // 5 seconds + constexpr std::string_view DEFAULT_DELTA_CHECKPOINT_INTERVAL_SEC_STR = "5s"; // 5 seconds constexpr i64 MAX_DELTA_CHECKPOINT_INTERVAL_SEC = 60 * 60 * 24 * 30; // 1 month constexpr i64 MIN_CHECKPOINT_INTERVAL_WAL_BYTES = 1024; // 1K constexpr i64 DELTA_CHECKPOINT_INTERVAL_WAL_BYTES = 64 * 1024l * 1024l; // 64 MB - constexpr String DELTA_CHECKPOINT_INTERVAL_WAL_BYTES_STR = "64MB"; // 64 MB + constexpr std::string_view DELTA_CHECKPOINT_INTERVAL_WAL_BYTES_STR = "64MB"; // 64 MB constexpr i64 MAX_CHECKPOINT_INTERVAL_WAL_BYTES = 1024l * 1024l * 1024l; // 1GB @@ -154,10 +154,10 @@ export { constexpr u32 DEFAULT_TENSOR_MAXSIM_OPTION_TOP_N = 10; constexpr SizeT DEFAULT_BUFFER_MANAGER_SIZE = 4 * 1024lu * 1024lu * 1024lu; // 4Gib - constexpr String DEFAULT_BUFFER_MANAGER_SIZE_STR = "4GB"; // 4Gib + constexpr std::string_view DEFAULT_BUFFER_MANAGER_SIZE_STR = "4GB"; // 4Gib constexpr SizeT DEFAULT_LOG_FILE_SIZE = 64 * 1024lu * 1024lu; // 64MB - constexpr String DEFAULT_LOG_FILE_SIZE_STR = "64MB"; // 64MB + constexpr std::string_view DEFAULT_LOG_FILE_SIZE_STR = "64MB"; // 64MB // config name constexpr std::string_view VERSION_OPTION_NAME = "version"; diff --git a/src/main/config.cpp b/src/main/config.cpp index ed25df49d1..be2ae48dd7 100644 --- a/src/main/config.cpp +++ b/src/main/config.cpp @@ -755,7 +755,7 @@ Status Config::Init(const SharedPtr &config_path) { // Log File Max Size i64 log_file_max_size = DEFAULT_LOG_FILE_SIZE; if (elem.second.is_string()) { - String log_file_max_size_str = elem.second.value_or(DEFAULT_LOG_FILE_SIZE_STR); + String log_file_max_size_str = elem.second.value_or(DEFAULT_LOG_FILE_SIZE_STR.data()); auto res = ParseByteSize(log_file_max_size_str, log_file_max_size); if (!res.ok()) { return res; @@ -934,7 +934,7 @@ Status Config::Init(const SharedPtr &config_path) { // Cleanup Interval i64 cleanup_interval = DEFAULT_CLEANUP_INTERVAL_SEC; if(elem.second.is_string()) { - String cleanup_interval_str = elem.second.value_or(DEFAULT_CLEANUP_INTERVAL_SEC_STR); + String cleanup_interval_str = elem.second.value_or(DEFAULT_CLEANUP_INTERVAL_SEC_STR.data()); auto res = ParseTimeInfo(cleanup_interval_str, cleanup_interval); if (!res.ok()) { return res; @@ -958,7 +958,7 @@ Status Config::Init(const SharedPtr &config_path) { // Compact Interval i64 compact_interval = DEFAULT_COMPACT_INTERVAL_SEC; if(elem.second.is_string()) { - String compact_interval_str = elem.second.value_or(DEFAULT_COMPACT_INTERVAL_SEC_STR); + String compact_interval_str = elem.second.value_or(DEFAULT_COMPACT_INTERVAL_SEC_STR.data()); auto res = ParseTimeInfo(compact_interval_str, compact_interval); if (!res.ok()) { return res; @@ -982,7 +982,7 @@ Status Config::Init(const SharedPtr &config_path) { // Optimize Index Interval i64 optimize_index_interval = DEFAULT_OPTIMIZE_INTERVAL_SEC; if(elem.second.is_string()) { - String optimize_index_interval_str = elem.second.value_or(DEFAULT_OPTIMIZE_INTERVAL_SEC_STR); + String optimize_index_interval_str = elem.second.value_or(DEFAULT_OPTIMIZE_INTERVAL_SEC_STR.data()); auto res = ParseTimeInfo(optimize_index_interval_str, optimize_index_interval); if (!res.ok()) { return res; @@ -1104,7 +1104,7 @@ Status Config::Init(const SharedPtr &config_path) { case GlobalOptionIndex::kBufferManagerSize: { i64 buffer_manager_size = DEFAULT_BUFFER_MANAGER_SIZE; if(elem.second.is_string()) { - String buffer_manager_size_str = elem.second.value_or(DEFAULT_BUFFER_MANAGER_SIZE_STR); + String buffer_manager_size_str = elem.second.value_or(DEFAULT_BUFFER_MANAGER_SIZE_STR.data()); auto res = ParseByteSize(buffer_manager_size_str, buffer_manager_size); if (!res.ok()) { return res; @@ -1201,7 +1201,7 @@ Status Config::Init(const SharedPtr &config_path) { i64 wal_compact_threshold = DEFAULT_WAL_FILE_SIZE_THRESHOLD; if (elem.second.is_string()) { - String wal_compact_threshold_str = elem.second.value_or(DEFAULT_WAL_FILE_SIZE_THRESHOLD_STR); + String wal_compact_threshold_str = elem.second.value_or(DEFAULT_WAL_FILE_SIZE_THRESHOLD_STR.data()); auto res = ParseByteSize(wal_compact_threshold_str, wal_compact_threshold); if (!res.ok()) { return res; @@ -1227,7 +1227,7 @@ Status Config::Init(const SharedPtr &config_path) { // Full Checkpoint Interval i64 full_checkpoint_interval = DEFAULT_FULL_CHECKPOINT_INTERVAL_SEC; if (elem.second.is_string()) { - String full_checkpoint_interval_str = elem.second.value_or(DEFAULT_FULL_CHECKPOINT_INTERVAL_SEC_STR); + String full_checkpoint_interval_str = elem.second.value_or(DEFAULT_FULL_CHECKPOINT_INTERVAL_SEC_STR.data()); auto res = ParseTimeInfo(full_checkpoint_interval_str, full_checkpoint_interval); if (!res.ok()) { return res; @@ -1254,7 +1254,7 @@ Status Config::Init(const SharedPtr &config_path) { // Delta Checkpoint Interval i64 delta_checkpoint_interval = DEFAULT_DELTA_CHECKPOINT_INTERVAL_SEC; if (elem.second.is_string()) { - String delta_checkpoint_interval_str = elem.second.value_or(DEFAULT_DELTA_CHECKPOINT_INTERVAL_SEC_STR); + String delta_checkpoint_interval_str = elem.second.value_or(DEFAULT_DELTA_CHECKPOINT_INTERVAL_SEC_STR.data()); auto res = ParseTimeInfo(delta_checkpoint_interval_str, delta_checkpoint_interval); if (!res.ok()) { return res; @@ -1281,7 +1281,7 @@ Status Config::Init(const SharedPtr &config_path) { // Delta Checkpoint Threshold i64 delta_checkpoint_threshold = DELTA_CHECKPOINT_INTERVAL_WAL_BYTES; if (elem.second.is_string()) { - String delta_checkpoint_threshold_str = elem.second.value_or(DELTA_CHECKPOINT_INTERVAL_WAL_BYTES_STR); + String delta_checkpoint_threshold_str = elem.second.value_or(DELTA_CHECKPOINT_INTERVAL_WAL_BYTES_STR.data()); auto res = ParseByteSize(delta_checkpoint_threshold_str, delta_checkpoint_threshold); if (!res.ok()) { return res; diff --git a/src/network/infinity_thrift_service.cpp b/src/network/infinity_thrift_service.cpp index 09d83f8586..7fa99f6b44 100644 --- a/src/network/infinity_thrift_service.cpp +++ b/src/network/infinity_thrift_service.cpp @@ -1965,7 +1965,7 @@ void InfinityThriftService::HandleRowIDType(infinity_thrift_rpc::ColumnField &ou output_column_field.__set_column_type(DataTypeToProtoColumnType(column_vector->data_type())); } -void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::CommonResponse &response, const Status &status, const String error_header) { +void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::CommonResponse &response, const Status &status, const std::string_view error_header) { response.__set_error_code((i64)(status.code())); if (!status.ok()) { response.__set_error_msg(status.message()); @@ -1973,7 +1973,7 @@ void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::CommonResponse &r } } -void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowDatabaseResponse &response, const Status &status, const String error_header) { +void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowDatabaseResponse &response, const Status &status, const std::string_view error_header) { response.__set_error_code((i64)(status.code())); if (!status.ok()) { response.__set_error_msg(status.message()); @@ -1981,7 +1981,7 @@ void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowDatabaseRespo } } -void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowTableResponse &response, const Status &status, const String error_header) { +void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowTableResponse &response, const Status &status, const std::string_view error_header) { response.__set_error_code((i64)(status.code())); if (!status.ok()) { response.__set_error_msg(status.message()); @@ -1989,7 +1989,7 @@ void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowTableResponse } } -void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowIndexResponse &response, const Status &status, const String error_header) { +void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowIndexResponse &response, const Status &status, const std::string_view error_header) { response.__set_error_code((i64)(status.code())); if (!status.ok()) { response.__set_error_msg(status.message()); @@ -1997,7 +1997,7 @@ void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowIndexResponse } } -void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::SelectResponse &response, const Status &status, const String error_header) { +void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::SelectResponse &response, const Status &status, const std::string_view error_header) { response.__set_error_code((i64)(status.code())); if (!status.ok()) { response.__set_error_msg(status.message()); @@ -2005,7 +2005,7 @@ void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::SelectResponse &r } } -void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ListDatabaseResponse &response, const Status &status, const String error_header) { +void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ListDatabaseResponse &response, const Status &status, const std::string_view error_header) { response.__set_error_code((i64)(status.code())); if (!status.ok()) { response.__set_error_msg(status.message()); @@ -2013,7 +2013,7 @@ void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ListDatabaseRespo } } -void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ListTableResponse &response, const Status &status, const String error_header) { +void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ListTableResponse &response, const Status &status, const std::string_view error_header) { response.__set_error_code((i64)(status.code())); if (!status.ok()) { response.__set_error_msg(status.message()); @@ -2021,7 +2021,7 @@ void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ListTableResponse } } -void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ListIndexResponse &response, const Status &status, const String error_header) { +void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ListIndexResponse &response, const Status &status, const std::string_view error_header) { response.__set_error_code((i64)(status.code())); if (!status.ok()) { response.__set_error_msg(status.message()); @@ -2029,7 +2029,7 @@ void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ListIndexResponse } } -void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowSegmentResponse &response, const Status &status, const String error_header) { +void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowSegmentResponse &response, const Status &status, const std::string_view error_header) { response.__set_error_code((i64)(status.code())); if (!status.ok()) { response.__set_error_msg(status.message()); @@ -2037,7 +2037,7 @@ void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowSegmentRespon } } -void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowBlockResponse &response, const Status &status, const String error_header) { +void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowBlockResponse &response, const Status &status, const std::string_view error_header) { response.__set_error_code((i64)(status.code())); if (!status.ok()) { response.__set_error_msg(status.message()); @@ -2045,7 +2045,7 @@ void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowBlockResponse } } -void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowBlockColumnResponse &response, const Status &status, const String error_header) { +void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowBlockColumnResponse &response, const Status &status, const std::string_view error_header) { response.__set_error_code((i64)(status.code())); if (!status.ok()) { response.__set_error_msg(status.message()); @@ -2053,7 +2053,7 @@ void InfinityThriftService::ProcessStatus(infinity_thrift_rpc::ShowBlockColumnRe } } -void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::CommonResponse &response, const QueryResult &result, const String error_header) { +void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::CommonResponse &response, const QueryResult &result, const std::string_view error_header) { response.__set_error_code((i64)(result.ErrorCode())); if (!result.IsOk()) { response.__set_error_msg(result.ErrorStr()); @@ -2061,7 +2061,7 @@ void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::CommonRespon } } -void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::SelectResponse &response, const QueryResult &result, const String error_header) { +void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::SelectResponse &response, const QueryResult &result, const std::string_view error_header) { response.__set_error_code((i64)(result.ErrorCode())); if (!result.IsOk()) { response.__set_error_msg(result.ErrorStr()); @@ -2071,7 +2071,7 @@ void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::SelectRespon void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ListDatabaseResponse &response, const QueryResult &result, - const String error_header) { + const std::string_view error_header) { response.__set_error_code((i64)(result.ErrorCode())); if (!result.IsOk()) { response.__set_error_msg(result.ErrorStr()); @@ -2081,7 +2081,7 @@ void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ListDatabase void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ListTableResponse &response, const QueryResult &result, - const String error_header) { + const std::string_view error_header) { response.__set_error_code((i64)(result.ErrorCode())); if (!result.IsOk()) { response.__set_error_msg(result.ErrorStr()); @@ -2091,7 +2091,7 @@ void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ListTableRes void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ListIndexResponse &response, const QueryResult &result, - const String error_header) { + const std::string_view error_header) { response.__set_error_code((i64)(result.ErrorCode())); if (!result.IsOk()) { response.__set_error_msg(result.ErrorStr()); @@ -2101,7 +2101,7 @@ void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ListIndexRes void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ShowDatabaseResponse &response, const QueryResult &result, - const String error_header) { + const std::string_view error_header) { response.__set_error_code((i64)(result.ErrorCode())); if (!result.IsOk()) { response.__set_error_msg(result.ErrorStr()); @@ -2111,7 +2111,7 @@ void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ShowDatabase void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ShowTableResponse &response, const QueryResult &result, - const String error_header) { + const std::string_view error_header) { response.__set_error_code((i64)(result.ErrorCode())); if (!result.IsOk()) { response.__set_error_msg(result.ErrorStr()); @@ -2121,7 +2121,7 @@ void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ShowTableRes void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ShowIndexResponse &response, const QueryResult &result, - const String error_header) { + const std::string_view error_header) { response.__set_error_code((i64)(result.ErrorCode())); if (!result.IsOk()) { response.__set_error_msg(result.ErrorStr()); @@ -2131,7 +2131,7 @@ void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ShowIndexRes void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ShowSegmentResponse &response, const QueryResult &result, - const String error_header) { + const std::string_view error_header) { response.__set_error_code((i64)(result.ErrorCode())); if (!result.IsOk()) { response.__set_error_msg(result.ErrorStr()); @@ -2141,7 +2141,7 @@ void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ShowSegmentR void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ShowBlockResponse &response, const QueryResult &result, - const String error_header) { + const std::string_view error_header) { response.__set_error_code((i64)(result.ErrorCode())); if (!result.IsOk()) { response.__set_error_msg(result.ErrorStr()); @@ -2151,7 +2151,7 @@ void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ShowBlockRes void InfinityThriftService::ProcessQueryResult(infinity_thrift_rpc::ShowBlockColumnResponse &response, const QueryResult &result, - const String error_header) { + const std::string_view error_header) { response.__set_error_code((i64)(result.ErrorCode())); if (!result.IsOk()) { response.__set_error_msg(result.ErrorStr()); diff --git a/src/network/infinity_thrift_service.cppm b/src/network/infinity_thrift_service.cppm index 40f4e151ac..acad5eef0b 100644 --- a/src/network/infinity_thrift_service.cppm +++ b/src/network/infinity_thrift_service.cppm @@ -46,7 +46,7 @@ namespace infinity { export class InfinityThriftService final : public infinity_thrift_rpc::InfinityServiceIf { private: - static constexpr String kErrorMsgHeader = "[THRIFT ERROR]"; + static constexpr std::string_view ErrorMsgHeader = "[THRIFT ERROR]"; public: InfinityThriftService() = default; @@ -185,61 +185,61 @@ private: void HandleRowIDType(infinity_thrift_rpc::ColumnField &output_column_field, SizeT row_count, const SharedPtr &column_vector); - static void ProcessStatus(infinity_thrift_rpc::CommonResponse &response, const Status &status, const String error_header = kErrorMsgHeader); + static void ProcessStatus(infinity_thrift_rpc::CommonResponse &response, const Status &status, const std::string_view error_header = ErrorMsgHeader); - static void ProcessStatus(infinity_thrift_rpc::ShowDatabaseResponse &response, const Status &status, const String error_header = kErrorMsgHeader); + static void ProcessStatus(infinity_thrift_rpc::ShowDatabaseResponse &response, const Status &status, const std::string_view error_header = ErrorMsgHeader); - static void ProcessStatus(infinity_thrift_rpc::ShowTableResponse &response, const Status &status, const String error_header = kErrorMsgHeader); + static void ProcessStatus(infinity_thrift_rpc::ShowTableResponse &response, const Status &status, const std::string_view error_header = ErrorMsgHeader); - static void ProcessStatus(infinity_thrift_rpc::ShowIndexResponse &response, const Status &status, const String error_header = kErrorMsgHeader); + static void ProcessStatus(infinity_thrift_rpc::ShowIndexResponse &response, const Status &status, const std::string_view error_header = ErrorMsgHeader); - static void ProcessStatus(infinity_thrift_rpc::SelectResponse &response, const Status &status, const String error_header = kErrorMsgHeader); + static void ProcessStatus(infinity_thrift_rpc::SelectResponse &response, const Status &status, const std::string_view error_header = ErrorMsgHeader); - static void ProcessStatus(infinity_thrift_rpc::ListDatabaseResponse &response, const Status &status, const String error_header = kErrorMsgHeader); + static void ProcessStatus(infinity_thrift_rpc::ListDatabaseResponse &response, const Status &status, const std::string_view error_header = ErrorMsgHeader); - static void ProcessStatus(infinity_thrift_rpc::ListTableResponse &response, const Status &status, const String error_header = kErrorMsgHeader); + static void ProcessStatus(infinity_thrift_rpc::ListTableResponse &response, const Status &status, const std::string_view error_header = ErrorMsgHeader); - static void ProcessStatus(infinity_thrift_rpc::ListIndexResponse &response, const Status &status, const String error_header = kErrorMsgHeader); + static void ProcessStatus(infinity_thrift_rpc::ListIndexResponse &response, const Status &status, const std::string_view error_header = ErrorMsgHeader); - static void ProcessStatus(infinity_thrift_rpc::ShowSegmentResponse &response, const Status &status, const String error_header = kErrorMsgHeader); + static void ProcessStatus(infinity_thrift_rpc::ShowSegmentResponse &response, const Status &status, const std::string_view error_header = ErrorMsgHeader); - static void ProcessStatus(infinity_thrift_rpc::ShowBlockResponse &response, const Status &status, const String error_header = kErrorMsgHeader); + static void ProcessStatus(infinity_thrift_rpc::ShowBlockResponse &response, const Status &status, const std::string_view error_header = ErrorMsgHeader); - static void ProcessStatus(infinity_thrift_rpc::ShowBlockColumnResponse &response, const Status &status, const String error_header = kErrorMsgHeader); + static void ProcessStatus(infinity_thrift_rpc::ShowBlockColumnResponse &response, const Status &status, const std::string_view error_header = ErrorMsgHeader); static void - ProcessQueryResult(infinity_thrift_rpc::CommonResponse &response, const QueryResult &result, const String error_header = kErrorMsgHeader); + ProcessQueryResult(infinity_thrift_rpc::CommonResponse &response, const QueryResult &result, const std::string_view error_header = ErrorMsgHeader); static void - ProcessQueryResult(infinity_thrift_rpc::SelectResponse &response, const QueryResult &result, const String error_header = kErrorMsgHeader); + ProcessQueryResult(infinity_thrift_rpc::SelectResponse &response, const QueryResult &result, const std::string_view error_header = ErrorMsgHeader); static void - ProcessQueryResult(infinity_thrift_rpc::ListDatabaseResponse &response, const QueryResult &result, const String error_header = kErrorMsgHeader); + ProcessQueryResult(infinity_thrift_rpc::ListDatabaseResponse &response, const QueryResult &result, const std::string_view error_header = ErrorMsgHeader); static void - ProcessQueryResult(infinity_thrift_rpc::ListTableResponse &response, const QueryResult &result, const String error_header = kErrorMsgHeader); + ProcessQueryResult(infinity_thrift_rpc::ListTableResponse &response, const QueryResult &result, const std::string_view error_header = ErrorMsgHeader); static void - ProcessQueryResult(infinity_thrift_rpc::ListIndexResponse &response, const QueryResult &result, const String error_header = kErrorMsgHeader); + ProcessQueryResult(infinity_thrift_rpc::ListIndexResponse &response, const QueryResult &result, const std::string_view error_header = ErrorMsgHeader); static void - ProcessQueryResult(infinity_thrift_rpc::ShowDatabaseResponse &response, const QueryResult &result, const String error_header = kErrorMsgHeader); + ProcessQueryResult(infinity_thrift_rpc::ShowDatabaseResponse &response, const QueryResult &result, const std::string_view error_header = ErrorMsgHeader); static void - ProcessQueryResult(infinity_thrift_rpc::ShowTableResponse &response, const QueryResult &result, const String error_header = kErrorMsgHeader); + ProcessQueryResult(infinity_thrift_rpc::ShowTableResponse &response, const QueryResult &result, const std::string_view error_header = ErrorMsgHeader); static void - ProcessQueryResult(infinity_thrift_rpc::ShowIndexResponse &response, const QueryResult &result, const String error_header = kErrorMsgHeader); + ProcessQueryResult(infinity_thrift_rpc::ShowIndexResponse &response, const QueryResult &result, const std::string_view error_header = ErrorMsgHeader); static void - ProcessQueryResult(infinity_thrift_rpc::ShowSegmentResponse &response, const QueryResult &result, const String error_header = kErrorMsgHeader); + ProcessQueryResult(infinity_thrift_rpc::ShowSegmentResponse &response, const QueryResult &result, const std::string_view error_header = ErrorMsgHeader); static void - ProcessQueryResult(infinity_thrift_rpc::ShowBlockResponse &response, const QueryResult &result, const String error_header = kErrorMsgHeader); + ProcessQueryResult(infinity_thrift_rpc::ShowBlockResponse &response, const QueryResult &result, const std::string_view error_header = ErrorMsgHeader); static void ProcessQueryResult(infinity_thrift_rpc::ShowBlockColumnResponse &response, const QueryResult &result, - const String error_header = kErrorMsgHeader); + const std::string_view error_header = ErrorMsgHeader); }; } // namespace infinity diff --git a/src/storage/invertedindex/index_defines.cppm b/src/storage/invertedindex/index_defines.cppm index d45790798c..25249fd4e0 100644 --- a/src/storage/invertedindex/index_defines.cppm +++ b/src/storage/invertedindex/index_defines.cppm @@ -57,8 +57,8 @@ export { using ScoredId = Pair; using ScoredIds = Vector; - constexpr String DEFAULT_SCORER = "bm25"; - constexpr String DEFAULT_SCORER_ARG = ""; + constexpr std::string_view DEFAULT_SCORER = "bm25"; + constexpr std::string_view DEFAULT_SCORER_ARG = ""; constexpr SizeT DEFAULT_TOPN = 100; }