From 02dfa94baae6f4f442d8daf0f53e3aa3a228c367 Mon Sep 17 00:00:00 2001 From: Alek5andr-Kotov Date: Mon, 9 Dec 2024 18:50:40 +0000 Subject: [PATCH 1/6] Moved commit "The test `TxUsage:: WriteToTopic_Demo_17`" from ydb repo --- src/client/topic/ut/topic_to_table_ut.cpp | 77 ++++++++++------------- 1 file changed, 33 insertions(+), 44 deletions(-) diff --git a/src/client/topic/ut/topic_to_table_ut.cpp b/src/client/topic/ut/topic_to_table_ut.cpp index fb77fbae99..6b65097513 100644 --- a/src/client/topic/ut/topic_to_table_ut.cpp +++ b/src/client/topic/ut/topic_to_table_ut.cpp @@ -192,9 +192,9 @@ class TFixture : public NUnitTest::TBaseFixture { NTable::TDataQueryResult ExecuteDataQuery(NTable::TSession session, const TString& query, const NTable::TTxControl& control); - void Read_Exactly_N_Messages_From_Topic(const TString& topicPath, - const TString& consumerName, - size_t count); + TVector Read_Exactly_N_Messages_From_Topic(const TString& topicPath, + const TString& consumerName, + size_t count); struct TAvgWriteBytes { ui64 PerSec = 0; @@ -1069,16 +1069,22 @@ void TFixture::RestartLongTxService() } } -void TFixture::Read_Exactly_N_Messages_From_Topic(const TString& topicPath, - const TString& consumerName, - size_t limit) +TVector TFixture::Read_Exactly_N_Messages_From_Topic(const TString& topicPath, + const TString& consumerName, + size_t limit) { - size_t count = 0; - while (count < limit) { + TVector result; + + while (result.size() < limit) { auto messages = ReadFromTopic(topicPath, consumerName, TDuration::Seconds(2)); - count += messages.size(); + for (auto& m : messages) { + result.push_back(std::move(m)); + } } - UNIT_ASSERT_VALUES_EQUAL(count, limit); + + UNIT_ASSERT_VALUES_EQUAL(result.size(), limit); + + return result; } auto TFixture::GetAvgWriteBytes(const TString& topicName, @@ -1141,15 +1147,13 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_1, TFixture) CommitTx(tx, EStatus::SUCCESS); { - auto messages = ReadFromTopic("topic_A", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 4); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_A", TEST_CONSUMER, 4); UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #1"); UNIT_ASSERT_VALUES_EQUAL(messages[3], "message #4"); } { - auto messages = ReadFromTopic("topic_B", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 5); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_B", TEST_CONSUMER, 5); UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #5"); UNIT_ASSERT_VALUES_EQUAL(messages[4], "message #9"); } @@ -1190,15 +1194,13 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_2, TFixture) CommitTx(tx, EStatus::SUCCESS); { - auto messages = ReadFromTopic("topic_A", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 4); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_A", TEST_CONSUMER, 4); UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #1"); UNIT_ASSERT_VALUES_EQUAL(messages[3], "message #4"); } { - auto messages = ReadFromTopic("topic_B", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 3); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_B", TEST_CONSUMER, 3); UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #7"); UNIT_ASSERT_VALUES_EQUAL(messages[2], "message #9"); } @@ -1299,15 +1301,13 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_5, TFixture) } { - auto messages = ReadFromTopic("topic_A", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 2); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_A", TEST_CONSUMER, 2); UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #1"); UNIT_ASSERT_VALUES_EQUAL(messages[1], "message #3"); } { - auto messages = ReadFromTopic("topic_B", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 2); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_B", TEST_CONSUMER, 2); UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #2"); UNIT_ASSERT_VALUES_EQUAL(messages[1], "message #4"); } @@ -1331,8 +1331,7 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_6, TFixture) CommitTx(tx, EStatus::SUCCESS); { - auto messages = ReadFromTopic("topic_A", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 2); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_A", TEST_CONSUMER, 2); UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #1"); UNIT_ASSERT_VALUES_EQUAL(messages[1], "message #2"); } @@ -1357,8 +1356,7 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_7, TFixture) WriteToTopic("topic_A", TEST_MESSAGE_GROUP_ID_1, "message #6", &tx); { - auto messages = ReadFromTopic("topic_A", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 2); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_A", TEST_CONSUMER, 2); UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #3"); UNIT_ASSERT_VALUES_EQUAL(messages[1], "message #4"); } @@ -1366,8 +1364,7 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_7, TFixture) CommitTx(tx, EStatus::SUCCESS); { - auto messages = ReadFromTopic("topic_A", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 4); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_A", TEST_CONSUMER, 4); UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #1"); UNIT_ASSERT_VALUES_EQUAL(messages[3], "message #6"); } @@ -1456,8 +1453,7 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_10, TFixture) } { - auto messages = ReadFromTopic("topic_A", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 2); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_A", TEST_CONSUMER, 2); UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #1"); UNIT_ASSERT_VALUES_EQUAL(messages[1], "message #2"); } @@ -1753,8 +1749,7 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_15, TFixture) CommitTx(tx, EStatus::SUCCESS); - auto messages = ReadFromTopic("topic_A", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 2); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_A", TEST_CONSUMER, 2); UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #1"); UNIT_ASSERT_VALUES_EQUAL(messages[1], "message #2"); } @@ -1773,8 +1768,7 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_16, TFixture) CommitTx(tx, EStatus::SUCCESS); - auto messages = ReadFromTopic("topic_A", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 2); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_A", TEST_CONSUMER, 2); UNIT_ASSERT_VALUES_EQUAL(messages[0], "message #1"); UNIT_ASSERT_VALUES_EQUAL(messages[1], "message #2"); } @@ -1800,8 +1794,7 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_17, TFixture) //RestartPQTablet("topic_A", 0); - auto messages = ReadFromTopic("topic_A", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 8); + auto messages = Read_Exactly_N_Messages_From_Topic("topic_A", TEST_CONSUMER, 8); UNIT_ASSERT_VALUES_EQUAL(messages[0].size(), 22'000'000); UNIT_ASSERT_VALUES_EQUAL(messages[1].size(), 100); UNIT_ASSERT_VALUES_EQUAL(messages[2].size(), 200); @@ -2033,8 +2026,7 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_25, TFixture) CommitTx(tx, EStatus::SUCCESS); - messages = ReadFromTopic("topic_B", TEST_CONSUMER, TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 3); + Read_Exactly_N_Messages_From_Topic("topic_B", TEST_CONSUMER, 3); } Y_UNIT_TEST_F(WriteToTopic_Demo_26, TFixture) @@ -2219,8 +2211,7 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_39, TFixture) CommitTx(tx, EStatus::SUCCESS); - auto messages = ReadFromTopic("topic_A", "consumer", TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 2); + Read_Exactly_N_Messages_From_Topic("topic_A", "consumer", 2); } Y_UNIT_TEST_F(ReadRuleGeneration, TFixture) @@ -2240,8 +2231,7 @@ Y_UNIT_TEST_F(ReadRuleGeneration, TFixture) AddConsumer(TString{TEST_TOPIC}, {"consumer-1"}); // We read messages from the topic and committed offsets - auto messages = ReadFromTopic(TString{TEST_TOPIC}, "consumer-1", TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 3); + Read_Exactly_N_Messages_From_Topic(TString{TEST_TOPIC}, "consumer-1", 3); CloseTopicReadSession(TString{TEST_TOPIC}, "consumer-1"); // And then the Logbroker team turned on the feature flag @@ -2254,8 +2244,7 @@ Y_UNIT_TEST_F(ReadRuleGeneration, TFixture) AddConsumer(TString{TEST_TOPIC}, {"consumer-2"}); // And they wanted to continue reading their messages - messages = ReadFromTopic(TString{TEST_TOPIC}, "consumer-1", TDuration::Seconds(2)); - UNIT_ASSERT_VALUES_EQUAL(messages.size(), 1); + Read_Exactly_N_Messages_From_Topic(TString{TEST_TOPIC}, "consumer-1", 1); } Y_UNIT_TEST_F(WriteToTopic_Demo_40, TFixture) From 2bcb478ee48d6a66efa4637bee13cdfaae7477c5 Mon Sep 17 00:00:00 2001 From: Bulat Gayazov Date: Mon, 9 Dec 2024 18:58:11 +0000 Subject: [PATCH 2/6] Added temporary inline namespace V3 --- .../client/common_client/settings.h | 2 +- .../client/common_client/ssl_credentials.h | 2 +- .../client/coordination/coordination.h | 2 +- .../client/datastreams/datastreams.h | 2 +- include/ydb-cpp-sdk/client/debug/client.h | 4 ++-- .../ydb-cpp-sdk/client/discovery/discovery.h | 4 ++-- .../client/draft/ydb_dynamic_config.h | 2 +- .../ydb-cpp-sdk/client/draft/ydb_replication.h | 8 ++++---- .../ydb-cpp-sdk/client/draft/ydb_scripting.h | 2 +- include/ydb-cpp-sdk/client/draft/ydb_view.h | 8 ++++---- include/ydb-cpp-sdk/client/driver/driver.h | 2 +- include/ydb-cpp-sdk/client/export/export.h | 2 +- .../client/extension_common/extension.h | 2 +- .../discovery_mutator/discovery_mutator.h | 4 ++-- .../extensions/solomon_stats/pull_client.h | 2 +- .../extensions/solomon_stats/pull_connector.h | 2 +- .../client/federated_topic/federated_topic.h | 4 ++-- include/ydb-cpp-sdk/client/helpers/helpers.h | 2 +- include/ydb-cpp-sdk/client/iam/common/types.h | 1 - include/ydb-cpp-sdk/client/iam/iam.h | 2 +- include/ydb-cpp-sdk/client/iam_private/iam.h | 2 +- include/ydb-cpp-sdk/client/import/import.h | 2 +- .../ydb-cpp-sdk/client/monitoring/monitoring.h | 4 ++-- .../ydb-cpp-sdk/client/operation/operation.h | 2 +- include/ydb-cpp-sdk/client/params/params.h | 4 ++-- include/ydb-cpp-sdk/client/proto/accessor.h | 2 +- include/ydb-cpp-sdk/client/query/client.h | 6 +++--- include/ydb-cpp-sdk/client/query/query.h | 4 ++-- include/ydb-cpp-sdk/client/query/stats.h | 8 ++++---- include/ydb-cpp-sdk/client/query/tx.h | 4 ++-- .../client/rate_limiter/rate_limiter.h | 4 ++-- include/ydb-cpp-sdk/client/resources/ydb_ca.h | 2 +- .../client/resources/ydb_resources.h | 2 +- include/ydb-cpp-sdk/client/result/result.h | 4 ++-- include/ydb-cpp-sdk/client/retry/retry.h | 4 ++-- include/ydb-cpp-sdk/client/scheme/scheme.h | 2 +- .../client/table/query_stats/stats.h | 2 +- include/ydb-cpp-sdk/client/table/table.h | 8 ++++---- include/ydb-cpp-sdk/client/table/table_enum.h | 2 +- include/ydb-cpp-sdk/client/topic/client.h | 4 ++-- include/ydb-cpp-sdk/client/topic/codecs.h | 4 ++-- .../ydb-cpp-sdk/client/topic/control_plane.h | 18 +++++++++--------- include/ydb-cpp-sdk/client/topic/counters.h | 4 ++-- include/ydb-cpp-sdk/client/topic/errors.h | 4 ++-- .../ydb-cpp-sdk/client/topic/events_common.h | 2 +- include/ydb-cpp-sdk/client/topic/executor.h | 2 +- include/ydb-cpp-sdk/client/topic/read_events.h | 2 +- .../ydb-cpp-sdk/client/topic/read_session.h | 4 ++-- .../ydb-cpp-sdk/client/topic/retry_policy.h | 4 ++-- .../ydb-cpp-sdk/client/topic/write_events.h | 2 +- .../ydb-cpp-sdk/client/topic/write_session.h | 4 ++-- .../client/types/credentials/credentials.h | 2 +- .../oauth2_token_exchange/credentials.h | 2 +- .../oauth2_token_exchange/from_file.h | 2 +- .../oauth2_token_exchange/jwt_token_source.h | 2 +- .../client/types/exceptions/exceptions.h | 2 +- .../types/fatal_error_handlers/handlers.h | 2 +- .../client/types/operation/operation.h | 2 +- .../client/types/request_settings.h | 2 +- include/ydb-cpp-sdk/client/types/s3_settings.h | 2 +- .../ydb-cpp-sdk/client/types/status/status.h | 2 +- .../ydb-cpp-sdk/client/types/status_codes.h | 2 +- include/ydb-cpp-sdk/client/types/ydb.h | 2 +- include/ydb-cpp-sdk/client/value/value.h | 2 +- src/api/protos/ydb_cms.proto | 3 ++- src/client/common_client/impl/client.h | 2 +- src/client/common_client/impl/iface.h | 2 +- src/client/common_client/settings.cpp | 2 +- src/client/coordination/coordination.cpp | 2 +- src/client/coordination/proto_accessor.cpp | 2 +- src/client/datastreams/datastreams.cpp | 2 +- src/client/debug/client.cpp | 2 +- src/client/discovery/discovery.cpp | 2 +- src/client/draft/ydb_dynamic_config.cpp | 4 ++-- src/client/draft/ydb_replication.cpp | 2 +- src/client/draft/ydb_scripting.cpp | 2 +- src/client/draft/ydb_view.cpp | 2 +- src/client/driver/driver.cpp | 2 +- src/client/export/export.cpp | 2 +- src/client/extension_common/extension.cpp | 2 +- .../extensions/solomon_stats/pull_client.cpp | 2 +- .../impl/federated_read_session.cpp | 4 ++-- .../impl/federated_read_session.h | 4 ++-- .../impl/federated_read_session_event.cpp | 6 +++--- .../federated_topic/impl/federated_topic.cpp | 4 ++-- .../impl/federated_topic_impl.cpp | 2 +- .../impl/federated_topic_impl.h | 4 ++-- .../impl/federated_write_session.cpp | 4 ++-- .../impl/federated_write_session.h | 4 ++-- .../impl/federation_observer.cpp | 4 ++-- .../federated_topic/impl/federation_observer.h | 4 ++-- src/client/helpers/helpers.cpp | 2 +- src/client/iam/common/iam.h | 2 +- src/client/iam/iam.cpp | 2 +- src/client/iam_private/iam.cpp | 2 +- src/client/impl/ydb_endpoints/endpoints.cpp | 2 +- src/client/impl/ydb_endpoints/endpoints.h | 2 +- .../impl/ydb_internal/common/client_pid.cpp | 2 +- .../impl/ydb_internal/common/client_pid.h | 2 +- src/client/impl/ydb_internal/common/getenv.cpp | 2 +- src/client/impl/ydb_internal/common/getenv.h | 2 +- src/client/impl/ydb_internal/common/parser.cpp | 2 +- src/client/impl/ydb_internal/common/parser.h | 2 +- src/client/impl/ydb_internal/common/types.h | 2 +- .../db_driver_state/authenticator.cpp | 2 +- .../db_driver_state/authenticator.h | 2 +- .../db_driver_state/endpoint_pool.cpp | 2 +- .../db_driver_state/endpoint_pool.h | 2 +- .../ydb_internal/db_driver_state/state.cpp | 2 +- .../impl/ydb_internal/db_driver_state/state.h | 2 +- .../impl/ydb_internal/driver/constants.h | 2 +- .../ydb_internal/grpc_connections/actions.cpp | 2 +- .../ydb_internal/grpc_connections/actions.h | 2 +- .../grpc_connections/grpc_connections.cpp | 2 +- .../grpc_connections/grpc_connections.h | 2 +- .../ydb_internal/grpc_connections/params.h | 2 +- .../impl/ydb_internal/internal_client/client.h | 2 +- .../kqp_session_common/kqp_session_common.cpp | 3 ++- .../kqp_session_common/kqp_session_common.h | 2 +- src/client/impl/ydb_internal/logger/log.cpp | 2 +- src/client/impl/ydb_internal/logger/log.h | 2 +- .../impl/ydb_internal/make_request/make.cpp | 2 +- .../impl/ydb_internal/make_request/make.h | 2 +- .../impl/ydb_internal/plain_status/status.cpp | 2 +- .../impl/ydb_internal/plain_status/status.h | 2 +- src/client/impl/ydb_internal/retry/retry.cpp | 2 +- src/client/impl/ydb_internal/retry/retry.h | 4 ++-- .../impl/ydb_internal/retry/retry_async.h | 2 +- .../impl/ydb_internal/retry/retry_sync.h | 2 +- .../rpc_request_settings/settings.h | 2 +- .../impl/ydb_internal/scheme_helpers/helpers.h | 2 +- .../session_client/session_client.h | 2 +- .../ydb_internal/session_pool/session_pool.cpp | 2 +- .../ydb_internal/session_pool/session_pool.h | 2 +- .../ydb_internal/stats_extractor/extractor.h | 2 +- .../impl/ydb_internal/table_helpers/helpers.h | 2 +- .../impl/ydb_internal/thread_pool/pool.h | 2 +- .../ydb_internal/value_helpers/helpers.cpp | 2 +- .../impl/ydb_internal/value_helpers/helpers.h | 2 +- src/client/impl/ydb_stats/stats.cpp | 2 +- src/client/impl/ydb_stats/stats.h | 6 ++---- src/client/import/import.cpp | 2 +- src/client/monitoring/monitoring.cpp | 2 +- src/client/operation/operation.cpp | 2 +- src/client/params/impl.cpp | 2 +- src/client/params/impl.h | 2 +- src/client/params/params.cpp | 2 +- src/client/persqueue_public/impl/aliases.h | 2 +- src/client/persqueue_public/impl/common.cpp | 2 +- src/client/persqueue_public/impl/common.h | 2 +- src/client/persqueue_public/impl/persqueue.cpp | 2 +- .../persqueue_public/impl/persqueue_impl.cpp | 2 +- .../persqueue_public/impl/persqueue_impl.h | 2 +- .../persqueue_public/impl/read_session.cpp | 2 +- .../persqueue_public/impl/read_session.h | 2 +- .../impl/read_session_messages.cpp | 2 +- .../persqueue_public/impl/write_session.cpp | 2 +- .../persqueue_public/impl/write_session.h | 2 +- .../impl/write_session_impl.cpp | 2 +- .../persqueue_public/impl/write_session_impl.h | 2 +- src/client/persqueue_public/include/aliases.h | 2 +- src/client/persqueue_public/include/client.h | 4 ++-- .../persqueue_public/include/control_plane.h | 6 +++--- .../persqueue_public/include/read_events.h | 2 +- .../persqueue_public/include/read_session.h | 2 +- .../persqueue_public/include/write_events.h | 2 +- .../persqueue_public/include/write_session.h | 2 +- src/client/proto/accessor.cpp | 2 +- src/client/query/client.cpp | 2 +- src/client/query/impl/client_session.cpp | 2 +- src/client/query/impl/client_session.h | 2 +- src/client/query/impl/exec_query.cpp | 2 +- src/client/query/impl/exec_query.h | 2 +- src/client/query/query.cpp | 2 +- src/client/query/stats.cpp | 2 +- src/client/rate_limiter/rate_limiter.cpp | 2 +- src/client/resources/ydb_ca.cpp | 2 +- src/client/resources/ydb_resources.cpp | 2 +- src/client/resources/ydb_sdk_version.txt | 2 +- src/client/result/proto_accessor.cpp | 2 +- src/client/result/result.cpp | 2 +- src/client/scheme/scheme.cpp | 2 +- src/client/ss_tasks/task.cpp | 2 +- src/client/ss_tasks/task.h | 2 +- src/client/table/impl/client_session.cpp | 2 +- src/client/table/impl/client_session.h | 2 +- src/client/table/impl/data_query.cpp | 2 +- src/client/table/impl/data_query.h | 2 +- src/client/table/impl/readers.cpp | 2 +- src/client/table/impl/readers.h | 2 +- src/client/table/impl/request_migrator.cpp | 2 +- src/client/table/impl/request_migrator.h | 2 +- src/client/table/impl/table_client.cpp | 2 +- src/client/table/impl/table_client.h | 2 +- src/client/table/impl/transaction.cpp | 2 +- src/client/table/impl/transaction.h | 2 +- src/client/table/proto_accessor.cpp | 2 +- src/client/table/query_stats/stats.cpp | 2 +- src/client/table/table.cpp | 2 +- src/client/topic/codecs/codecs.cpp | 2 +- src/client/topic/common/callback_context.h | 2 +- src/client/topic/common/executor_impl.cpp | 2 +- src/client/topic/common/executor_impl.h | 2 +- src/client/topic/common/retry_policy.cpp | 2 +- src/client/topic/impl/common.cpp | 2 +- src/client/topic/impl/common.h | 2 +- src/client/topic/impl/counters_logger.h | 2 +- src/client/topic/impl/deferred_commit.cpp | 2 +- src/client/topic/impl/event_handlers.cpp | 2 +- src/client/topic/impl/offsets_collector.cpp | 2 +- src/client/topic/impl/offsets_collector.h | 2 +- src/client/topic/impl/read_session.cpp | 2 +- src/client/topic/impl/read_session.h | 2 +- src/client/topic/impl/read_session_event.cpp | 2 +- src/client/topic/impl/read_session_impl.h | 2 +- src/client/topic/impl/read_session_impl.ipp | 2 +- src/client/topic/impl/topic.cpp | 2 +- src/client/topic/impl/topic_impl.cpp | 2 +- src/client/topic/impl/topic_impl.h | 2 +- src/client/topic/impl/transaction.cpp | 2 +- src/client/topic/impl/transaction.h | 4 ++-- src/client/topic/impl/write_session.cpp | 2 +- src/client/topic/impl/write_session.h | 2 +- src/client/topic/impl/write_session_impl.cpp | 2 +- src/client/topic/impl/write_session_impl.h | 2 +- src/client/topic/proto_accessor.cpp | 2 +- src/client/types/core_facility/core_facility.h | 2 +- src/client/types/credentials/credentials.cpp | 2 +- src/client/types/credentials/login/login.cpp | 2 +- .../oauth2_token_exchange/credentials.cpp | 2 +- .../oauth2_token_exchange/from_file.cpp | 2 +- .../oauth2_token_exchange/jwt_token_source.cpp | 2 +- src/client/types/exceptions/exceptions.cpp | 2 +- .../types/fatal_error_handlers/handlers.cpp | 2 +- src/client/types/operation/operation.cpp | 2 +- src/client/types/status/status.cpp | 2 +- src/client/value/value.cpp | 2 +- tests/unit/client/draft/helpers/grpc_server.h | 2 +- .../draft/helpers/grpc_services/scripting.cpp | 2 +- .../draft/helpers/grpc_services/scripting.h | 2 +- .../draft/helpers/grpc_services/view.cpp | 2 +- .../client/draft/helpers/grpc_services/view.h | 2 +- .../ydb_scripting_response_headers_ut.cpp | 2 +- tests/unit/client/draft/ydb_view_ut.cpp | 2 +- 244 files changed, 302 insertions(+), 303 deletions(-) diff --git a/include/ydb-cpp-sdk/client/common_client/settings.h b/include/ydb-cpp-sdk/client/common_client/settings.h index 8d77fe0fe9..302898dea4 100644 --- a/include/ydb-cpp-sdk/client/common_client/settings.h +++ b/include/ydb-cpp-sdk/client/common_client/settings.h @@ -8,7 +8,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { using TCertificateAndPrivateKey = std::pair; diff --git a/include/ydb-cpp-sdk/client/common_client/ssl_credentials.h b/include/ydb-cpp-sdk/client/common_client/ssl_credentials.h index be66fe8010..3b452b9d03 100644 --- a/include/ydb-cpp-sdk/client/common_client/ssl_credentials.h +++ b/include/ydb-cpp-sdk/client/common_client/ssl_credentials.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { struct TSslCredentials { bool IsEnabled = false; diff --git a/include/ydb-cpp-sdk/client/coordination/coordination.h b/include/ydb-cpp-sdk/client/coordination/coordination.h index 695df8b5cd..8d4fa0f1f4 100644 --- a/include/ydb-cpp-sdk/client/coordination/coordination.h +++ b/include/ydb-cpp-sdk/client/coordination/coordination.h @@ -10,7 +10,7 @@ namespace Coordination { } } -namespace NYdb { +namespace NYdb::inline V3 { namespace NScheme { struct TPermissions; diff --git a/include/ydb-cpp-sdk/client/datastreams/datastreams.h b/include/ydb-cpp-sdk/client/datastreams/datastreams.h index b995d75b2f..59329a2127 100644 --- a/include/ydb-cpp-sdk/client/datastreams/datastreams.h +++ b/include/ydb-cpp-sdk/client/datastreams/datastreams.h @@ -4,7 +4,7 @@ #include -namespace NYdb::NDataStreams::V1 { +namespace NYdb::inline V3::NDataStreams::V1 { template class TProtoResultWrapper : public NYdb::TStatus { diff --git a/include/ydb-cpp-sdk/client/debug/client.h b/include/ydb-cpp-sdk/client/debug/client.h index bfd8a94679..7ee45e5a4f 100644 --- a/include/ydb-cpp-sdk/client/debug/client.h +++ b/include/ydb-cpp-sdk/client/debug/client.h @@ -2,7 +2,7 @@ #include -namespace NYdb::NDebug { +namespace NYdb::inline V3::NDebug { //////////////////////////////////////////////////////////////////////////////// @@ -80,4 +80,4 @@ class TDebugClient { std::shared_ptr Impl_; }; -} // namespace NYdb::NDebug +} // namespace NYdb::V3::NDebug diff --git a/include/ydb-cpp-sdk/client/discovery/discovery.h b/include/ydb-cpp-sdk/client/discovery/discovery.h index 81301e189c..f9bf7a2723 100644 --- a/include/ydb-cpp-sdk/client/discovery/discovery.h +++ b/include/ydb-cpp-sdk/client/discovery/discovery.h @@ -12,7 +12,7 @@ namespace Discovery { } // namespace Discovery } // namespace Ydb -namespace NYdb { +namespace NYdb::inline V3 { namespace NDiscovery { //////////////////////////////////////////////////////////////////////////////// @@ -140,5 +140,5 @@ class TDiscoveryClient { std::shared_ptr Impl_; }; -} // namespace NTable } // namespace NDiscovery +} // namespace NYdb diff --git a/include/ydb-cpp-sdk/client/draft/ydb_dynamic_config.h b/include/ydb-cpp-sdk/client/draft/ydb_dynamic_config.h index 8e6ffcc0ad..5333a66fa7 100644 --- a/include/ydb-cpp-sdk/client/draft/ydb_dynamic_config.h +++ b/include/ydb-cpp-sdk/client/draft/ydb_dynamic_config.h @@ -8,7 +8,7 @@ #include -namespace NYdb::NDynamicConfig { +namespace NYdb::inline V3::NDynamicConfig { struct TGetConfigResult : public TStatus { TGetConfigResult( diff --git a/include/ydb-cpp-sdk/client/draft/ydb_replication.h b/include/ydb-cpp-sdk/client/draft/ydb_replication.h index 3cb919dd85..cfd9e9402f 100644 --- a/include/ydb-cpp-sdk/client/draft/ydb_replication.h +++ b/include/ydb-cpp-sdk/client/draft/ydb_replication.h @@ -13,11 +13,11 @@ namespace Ydb::Replication { class DescribeReplicationResult_Stats; } -namespace NYdb { +namespace NYdb::inline V3 { class TProtoAccessor; } -namespace NYdb::NReplication { +namespace NYdb::inline V3::NReplication { class TDescribeReplicationResult; using TAsyncDescribeReplicationResult = NThreading::TFuture; @@ -135,7 +135,7 @@ class TReplicationDescription { }; class TDescribeReplicationResult: public NScheme::TDescribePathResult { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; const Ydb::Replication::DescribeReplicationResult& GetProto() const; public: @@ -160,4 +160,4 @@ class TReplicationClient { std::shared_ptr Impl_; }; -} // namespace NYdb::NReplication +} // namespace NYdb::V3::NReplication diff --git a/include/ydb-cpp-sdk/client/draft/ydb_scripting.h b/include/ydb-cpp-sdk/client/draft/ydb_scripting.h index a921a29618..274d381490 100644 --- a/include/ydb-cpp-sdk/client/draft/ydb_scripting.h +++ b/include/ydb-cpp-sdk/client/draft/ydb_scripting.h @@ -3,7 +3,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NScripting { class TExecuteYqlResult : public TStatus { diff --git a/include/ydb-cpp-sdk/client/draft/ydb_view.h b/include/ydb-cpp-sdk/client/draft/ydb_view.h index e2318c33be..7426b03252 100644 --- a/include/ydb-cpp-sdk/client/draft/ydb_view.h +++ b/include/ydb-cpp-sdk/client/draft/ydb_view.h @@ -7,11 +7,11 @@ namespace Ydb::View { class DescribeViewResult; } -namespace NYdb { +namespace NYdb::inline V3 { class TProtoAccessor; } -namespace NYdb::NView { +namespace NYdb::inline V3::NView { class TDescribeViewResult; using TAsyncDescribeViewResult = NThreading::TFuture; @@ -31,7 +31,7 @@ class TViewDescription { }; class TDescribeViewResult : public NScheme::TDescribePathResult { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; const Ydb::View::DescribeViewResult& GetProto() const; public: @@ -55,4 +55,4 @@ class TViewClient { std::shared_ptr Impl_; }; -} // namespace NYdb::NView +} // namespace NYdb::V3::NView diff --git a/include/ydb-cpp-sdk/client/driver/driver.h b/include/ydb-cpp-sdk/client/driver/driver.h index 8a1bc503af..8d9342aac6 100644 --- a/include/ydb-cpp-sdk/client/driver/driver.h +++ b/include/ydb-cpp-sdk/client/driver/driver.h @@ -11,7 +11,7 @@ //////////////////////////////////////////////////////////////////////////////// -namespace NYdb { +namespace NYdb::inline V3 { class TDriver; class TGRpcConnectionsImpl; diff --git a/include/ydb-cpp-sdk/client/export/export.h b/include/ydb-cpp-sdk/client/export/export.h index 61587ae2d7..2f87c880da 100644 --- a/include/ydb-cpp-sdk/client/export/export.h +++ b/include/ydb-cpp-sdk/client/export/export.h @@ -4,7 +4,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NExport { /// Common diff --git a/include/ydb-cpp-sdk/client/extension_common/extension.h b/include/ydb-cpp-sdk/client/extension_common/extension.h index fde78c9687..23861eecdc 100644 --- a/include/ydb-cpp-sdk/client/extension_common/extension.h +++ b/include/ydb-cpp-sdk/client/extension_common/extension.h @@ -12,7 +12,7 @@ class ListEndpointsResult; } } -namespace NYdb { +namespace NYdb::inline V3 { class IExtensionApi { public: diff --git a/include/ydb-cpp-sdk/client/extensions/discovery_mutator/discovery_mutator.h b/include/ydb-cpp-sdk/client/extensions/discovery_mutator/discovery_mutator.h index cdffc25ac5..d82248da25 100644 --- a/include/ydb-cpp-sdk/client/extensions/discovery_mutator/discovery_mutator.h +++ b/include/ydb-cpp-sdk/client/extensions/discovery_mutator/discovery_mutator.h @@ -2,7 +2,7 @@ #include -namespace NDiscoveryMutator { +namespace NDiscoveryMutator::inline V3 { class TDiscoveryMutator: public NYdb::IExtension { public: @@ -26,4 +26,4 @@ class TDiscoveryMutator: public NYdb::IExtension { } }; -}; // namespace NDiscoveryModifie +} // namespace NDiscoveryMutator diff --git a/include/ydb-cpp-sdk/client/extensions/solomon_stats/pull_client.h b/include/ydb-cpp-sdk/client/extensions/solomon_stats/pull_client.h index 94ccd852a4..c2f1775f6a 100644 --- a/include/ydb-cpp-sdk/client/extensions/solomon_stats/pull_client.h +++ b/include/ydb-cpp-sdk/client/extensions/solomon_stats/pull_client.h @@ -8,7 +8,7 @@ #include #include -namespace NSolomonStatExtension { +namespace NSolomonStatExtension::inline V3 { class TSolomonStatPullExtension: public NYdb::IExtension { public: diff --git a/include/ydb-cpp-sdk/client/extensions/solomon_stats/pull_connector.h b/include/ydb-cpp-sdk/client/extensions/solomon_stats/pull_connector.h index 46734fab58..a33121063b 100644 --- a/include/ydb-cpp-sdk/client/extensions/solomon_stats/pull_connector.h +++ b/include/ydb-cpp-sdk/client/extensions/solomon_stats/pull_connector.h @@ -4,7 +4,7 @@ #include -namespace NSolomonStatExtension { +namespace NSolomonStatExtension::inline V3 { template class TMetricRegistryConnector: public NYdb::IExtension { diff --git a/include/ydb-cpp-sdk/client/federated_topic/federated_topic.h b/include/ydb-cpp-sdk/client/federated_topic/federated_topic.h index f952fd6c54..e1fff416ab 100644 --- a/include/ydb-cpp-sdk/client/federated_topic/federated_topic.h +++ b/include/ydb-cpp-sdk/client/federated_topic/federated_topic.h @@ -8,7 +8,7 @@ #include -namespace NYdb::NFederatedTopic { +namespace NYdb::inline V3::NFederatedTopic { using NTopic::TPrintable; using TDbInfo = Ydb::FederationDiscovery::DatabaseInfo; @@ -525,7 +525,7 @@ class TFederatedTopicClient { } // namespace NYdb::NFederatedTopic -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { using namespace NFederatedTopic; diff --git a/include/ydb-cpp-sdk/client/helpers/helpers.h b/include/ydb-cpp-sdk/client/helpers/helpers.h index ce1a1fd63c..94357086de 100644 --- a/include/ydb-cpp-sdk/client/helpers/helpers.h +++ b/include/ydb-cpp-sdk/client/helpers/helpers.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { //! Checks the following environment variables and creates TDriverConfig with the first appeared: //! YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS= — service account key file, diff --git a/include/ydb-cpp-sdk/client/iam/common/types.h b/include/ydb-cpp-sdk/client/iam/common/types.h index 0f1cc384d9..8f5fe3dac6 100644 --- a/include/ydb-cpp-sdk/client/iam/common/types.h +++ b/include/ydb-cpp-sdk/client/iam/common/types.h @@ -9,7 +9,6 @@ #include namespace NYdb { - namespace NIam { constexpr std::string_view DEFAULT_ENDPOINT = "iam.api.cloud.yandex.net"; diff --git a/include/ydb-cpp-sdk/client/iam/iam.h b/include/ydb-cpp-sdk/client/iam/iam.h index a79c200dc7..81b41068ca 100644 --- a/include/ydb-cpp-sdk/client/iam/iam.h +++ b/include/ydb-cpp-sdk/client/iam/iam.h @@ -2,7 +2,7 @@ #include "common/types.h" -namespace NYdb { +namespace NYdb::inline V3 { /// Acquire an IAM token using a local metadata service on a virtual machine. TCredentialsProviderFactoryPtr CreateIamCredentialsProviderFactory(const TIamHost& params = {}); diff --git a/include/ydb-cpp-sdk/client/iam_private/iam.h b/include/ydb-cpp-sdk/client/iam_private/iam.h index 3b2d742d16..c4373c9478 100644 --- a/include/ydb-cpp-sdk/client/iam_private/iam.h +++ b/include/ydb-cpp-sdk/client/iam_private/iam.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { /// Acquire an IAM token using a JSON Web Token (JWT) file name. TCredentialsProviderFactoryPtr CreateIamJwtFileCredentialsProviderFactoryPrivate(const TIamJwtFilename& params); diff --git a/include/ydb-cpp-sdk/client/import/import.h b/include/ydb-cpp-sdk/client/import/import.h index dd2b6a4ceb..f80b9fd8bd 100644 --- a/include/ydb-cpp-sdk/client/import/import.h +++ b/include/ydb-cpp-sdk/client/import/import.h @@ -5,7 +5,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NImport { /// Common diff --git a/include/ydb-cpp-sdk/client/monitoring/monitoring.h b/include/ydb-cpp-sdk/client/monitoring/monitoring.h index 77799e8d8c..f8dfc27994 100644 --- a/include/ydb-cpp-sdk/client/monitoring/monitoring.h +++ b/include/ydb-cpp-sdk/client/monitoring/monitoring.h @@ -8,7 +8,7 @@ namespace Monitoring { } } -namespace NYdb { +namespace NYdb::inline V3 { class TProtoAccessor; @@ -33,7 +33,7 @@ struct TSelfCheckSettings : public TOperationRequestSettings }; class TSelfCheckResult : public TStatus { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; public: TSelfCheckResult(TStatus&& status, Ydb::Monitoring::SelfCheckResult&& result); private: diff --git a/include/ydb-cpp-sdk/client/operation/operation.h b/include/ydb-cpp-sdk/client/operation/operation.h index 314b9879aa..6416f6cc81 100644 --- a/include/ydb-cpp-sdk/client/operation/operation.h +++ b/include/ydb-cpp-sdk/client/operation/operation.h @@ -3,7 +3,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NOperation { template diff --git a/include/ydb-cpp-sdk/client/params/params.h b/include/ydb-cpp-sdk/client/params/params.h index d7f72bcc4b..1092c2bb88 100644 --- a/include/ydb-cpp-sdk/client/params/params.h +++ b/include/ydb-cpp-sdk/client/params/params.h @@ -9,7 +9,7 @@ namespace Ydb { class TypedValue; } -namespace NYdb { +namespace NYdb::inline V3 { namespace NScripting { class TScriptingClient; @@ -43,7 +43,7 @@ class TParams { friend class NExperimental::TStreamQueryClient; friend class NQuery::TExecQueryImpl; friend class NQuery::TQueryClient; - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; public: bool Empty() const; diff --git a/include/ydb-cpp-sdk/client/proto/accessor.h b/include/ydb-cpp-sdk/client/proto/accessor.h index e2ff8c7589..cee4869a98 100644 --- a/include/ydb-cpp-sdk/client/proto/accessor.h +++ b/include/ydb-cpp-sdk/client/proto/accessor.h @@ -19,7 +19,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { class TResultSet; class TValue; diff --git a/include/ydb-cpp-sdk/client/query/client.h b/include/ydb-cpp-sdk/client/query/client.h index 08eb754f08..d608b18f67 100644 --- a/include/ydb-cpp-sdk/client/query/client.h +++ b/include/ydb-cpp-sdk/client/query/client.h @@ -8,7 +8,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { class TProtoAccessor; namespace NRetry::Async { @@ -21,7 +21,7 @@ namespace NYdb { } // namespace NRetry::Sync } -namespace NYdb::NQuery { +namespace NYdb::inline V3::NQuery { struct TCreateSessionSettings : public TSimpleRequestSettings { TCreateSessionSettings(); @@ -264,4 +264,4 @@ class TExecuteQueryResult : public TStatus { std::optional Transaction_; }; -} // namespace NYdb::NQuery +} // namespace NYdb::V3::NQuery diff --git a/include/ydb-cpp-sdk/client/query/query.h b/include/ydb-cpp-sdk/client/query/query.h index 959d22e032..6ecc64393d 100644 --- a/include/ydb-cpp-sdk/client/query/query.h +++ b/include/ydb-cpp-sdk/client/query/query.h @@ -10,7 +10,7 @@ #include -namespace NYdb::NQuery { +namespace NYdb::inline V3::NQuery { enum class ESyntax { Unspecified = 0, @@ -186,4 +186,4 @@ class TExecuteQueryResult; using TAsyncFetchScriptResultsResult = NThreading::TFuture; using TAsyncExecuteQueryResult = NThreading::TFuture; -} // namespace NYdb::NQuery +} // namespace NYdb::V3::NQuery diff --git a/include/ydb-cpp-sdk/client/query/stats.h b/include/ydb-cpp-sdk/client/query/stats.h index 617cbd976c..92856ba1eb 100644 --- a/include/ydb-cpp-sdk/client/query/stats.h +++ b/include/ydb-cpp-sdk/client/query/stats.h @@ -12,14 +12,14 @@ namespace Ydb::TableStats { class QueryStats; } -namespace NYdb { +namespace NYdb::inline V3 { class TProtoAccessor; } -namespace NYdb::NQuery { +namespace NYdb::inline V3::NQuery { class TExecStats { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; public: TExecStats() = default; @@ -43,4 +43,4 @@ class TExecStats { std::shared_ptr Impl_; }; -} // namespace NYdb::NQuery +} // namespace NYdb::V3::NQuery diff --git a/include/ydb-cpp-sdk/client/query/tx.h b/include/ydb-cpp-sdk/client/query/tx.h index c73e0b8c1d..aad7684cf9 100644 --- a/include/ydb-cpp-sdk/client/query/tx.h +++ b/include/ydb-cpp-sdk/client/query/tx.h @@ -6,7 +6,7 @@ #include -namespace NYdb::NQuery { +namespace NYdb::inline V3::NQuery { struct TTxOnlineSettings { using TSelf = TTxOnlineSettings; @@ -108,4 +108,4 @@ struct TTxControl { : TxSettings_(txSettings) {} }; -} // namespace NYdb::NQuery +} // namespace NYdb::V3::NQuery diff --git a/include/ydb-cpp-sdk/client/rate_limiter/rate_limiter.h b/include/ydb-cpp-sdk/client/rate_limiter/rate_limiter.h index 406776c092..040e65f8f7 100644 --- a/include/ydb-cpp-sdk/client/rate_limiter/rate_limiter.h +++ b/include/ydb-cpp-sdk/client/rate_limiter/rate_limiter.h @@ -7,7 +7,7 @@ class DescribeResourceResult; class HierarchicalDrrSettings; } // namespace Ydb::RateLimiter -namespace NYdb::NRateLimiter { +namespace NYdb::inline V3::NRateLimiter { // Settings for hierarchical deficit round robin (HDRR) algorithm. template @@ -171,4 +171,4 @@ class TRateLimiterClient { std::shared_ptr Impl_; }; -} // namespace NYdb::NRateLimiter +} // namespace NYdb::V3::NRateLimiter diff --git a/include/ydb-cpp-sdk/client/resources/ydb_ca.h b/include/ydb-cpp-sdk/client/resources/ydb_ca.h index 05add5c68b..e3b3bf055b 100644 --- a/include/ydb-cpp-sdk/client/resources/ydb_ca.h +++ b/include/ydb-cpp-sdk/client/resources/ydb_ca.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { std::string GetRootCertificate(); diff --git a/include/ydb-cpp-sdk/client/resources/ydb_resources.h b/include/ydb-cpp-sdk/client/resources/ydb_resources.h index d57980400d..02a8e26681 100644 --- a/include/ydb-cpp-sdk/client/resources/ydb_resources.h +++ b/include/ydb-cpp-sdk/client/resources/ydb_resources.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { extern const char* YDB_AUTH_TICKET_HEADER; extern const char* YDB_DATABASE_HEADER; diff --git a/include/ydb-cpp-sdk/client/result/result.h b/include/ydb-cpp-sdk/client/result/result.h index b8ed909110..d7caa0249e 100644 --- a/include/ydb-cpp-sdk/client/result/result.h +++ b/include/ydb-cpp-sdk/client/result/result.h @@ -8,7 +8,7 @@ namespace Ydb { class ResultSet; } -namespace NYdb { +namespace NYdb::inline V3 { class TProtoAccessor; @@ -30,7 +30,7 @@ bool operator!=(const TColumn& col1, const TColumn& col2); //! Collection of rows, represents result of query or part of the result in case of stream operations class TResultSet { friend class TResultSetParser; - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; public: TResultSet(const Ydb::ResultSet& proto); TResultSet(Ydb::ResultSet&& proto); diff --git a/include/ydb-cpp-sdk/client/retry/retry.h b/include/ydb-cpp-sdk/client/retry/retry.h index 36bbd23a8f..748bd3a4bf 100644 --- a/include/ydb-cpp-sdk/client/retry/retry.h +++ b/include/ydb-cpp-sdk/client/retry/retry.h @@ -3,7 +3,7 @@ #include #include -namespace NYdb::NRetry { +namespace NYdb::inline V3::NRetry { struct TBackoffSettings { using TSelf = TBackoffSettings; @@ -41,4 +41,4 @@ struct TRetryOperationSettings { } }; -} // namespace NYdb::NRetry +} // namespace NYdb::V3::NRetry diff --git a/include/ydb-cpp-sdk/client/scheme/scheme.h b/include/ydb-cpp-sdk/client/scheme/scheme.h index cec51105ae..1351d61875 100644 --- a/include/ydb-cpp-sdk/client/scheme/scheme.h +++ b/include/ydb-cpp-sdk/client/scheme/scheme.h @@ -11,7 +11,7 @@ namespace Ydb { } } -namespace NYdb { +namespace NYdb::inline V3 { namespace NScheme { //////////////////////////////////////////////////////////////////////////////// diff --git a/include/ydb-cpp-sdk/client/table/query_stats/stats.h b/include/ydb-cpp-sdk/client/table/query_stats/stats.h index 00a1192a6c..38740d2dd1 100644 --- a/include/ydb-cpp-sdk/client/table/query_stats/stats.h +++ b/include/ydb-cpp-sdk/client/table/query_stats/stats.h @@ -14,7 +14,7 @@ namespace Ydb { } } -namespace NYdb { +namespace NYdb::inline V3 { class TProtoAccessor; diff --git a/include/ydb-cpp-sdk/client/table/table.h b/include/ydb-cpp-sdk/client/table/table.h index 69503ff1ad..df587ff3b1 100644 --- a/include/ydb-cpp-sdk/client/table/table.h +++ b/include/ydb-cpp-sdk/client/table/table.h @@ -38,7 +38,7 @@ class ValueSinceUnixEpochModeSettingsV1; } // namespace Table } // namespace Ydb -namespace NYdb { +namespace NYdb::inline V3 { namespace NRetry::Async { template @@ -269,7 +269,7 @@ struct TKMeansTreeSettings { //! Represents index description class TIndexDescription { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; public: TIndexDescription( @@ -346,7 +346,7 @@ class TBuildIndexOperation : public TOperation { //! Represents changefeed description class TChangefeedDescription { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; public: class TInitialScanProgress { @@ -651,7 +651,7 @@ enum class EStoreType { //! Represents table description class TTableDescription { friend class TTableBuilder; - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; using EUnit = TValueSinceUnixEpochModeSettings::EUnit; diff --git a/include/ydb-cpp-sdk/client/table/table_enum.h b/include/ydb-cpp-sdk/client/table/table_enum.h index 1660706f57..7c5197a84d 100644 --- a/include/ydb-cpp-sdk/client/table/table_enum.h +++ b/include/ydb-cpp-sdk/client/table/table_enum.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NTable { //! Column family compression codec diff --git a/include/ydb-cpp-sdk/client/topic/client.h b/include/ydb-cpp-sdk/client/topic/client.h index d8f8cb92bc..1b1ea70c80 100644 --- a/include/ydb-cpp-sdk/client/topic/client.h +++ b/include/ydb-cpp-sdk/client/topic/client.h @@ -4,7 +4,7 @@ #include "read_session.h" #include "write_session.h" -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { struct TTopicClientSettings : public TCommonClientSettingsBase { using TSelf = TTopicClientSettings; @@ -61,4 +61,4 @@ class TTopicClient { std::shared_ptr Impl_; }; -} // namespace NYdb::NTopic +} // namespace NYdb::V3::NTopic diff --git a/include/ydb-cpp-sdk/client/topic/codecs.h b/include/ydb-cpp-sdk/client/topic/codecs.h index a1e2e288da..a91c87afee 100644 --- a/include/ydb-cpp-sdk/client/topic/codecs.h +++ b/include/ydb-cpp-sdk/client/topic/codecs.h @@ -11,7 +11,7 @@ #include #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { enum class ECodec : uint32_t { RAW = 1, @@ -93,4 +93,4 @@ class TCodecMap { TAdaptiveLock Lock; }; -} // namespace NYdb::NTopic +} // namespace NYdb::V3::NTopic diff --git a/include/ydb-cpp-sdk/client/topic/control_plane.h b/include/ydb-cpp-sdk/client/topic/control_plane.h index 42e4b84052..1424c0ae22 100644 --- a/include/ydb-cpp-sdk/client/topic/control_plane.h +++ b/include/ydb-cpp-sdk/client/topic/control_plane.h @@ -10,7 +10,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { class TProtoAccessor; namespace NScheme { @@ -18,7 +18,7 @@ namespace NYdb { } } -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { enum class EMeteringMode : uint32_t { Unspecified = 0, @@ -257,7 +257,7 @@ struct TAlterPartitioningSettings { }; class TTopicDescription { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; public: TTopicDescription(Ydb::Topic::DescribeTopicResult&& desc); @@ -320,7 +320,7 @@ class TTopicDescription { }; class TConsumerDescription { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; public: TConsumerDescription(Ydb::Topic::DescribeConsumerResult&& desc); @@ -340,7 +340,7 @@ class TConsumerDescription { }; class TPartitionDescription { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; public: TPartitionDescription(Ydb::Topic::DescribePartitionResult&& desc); @@ -355,7 +355,7 @@ class TPartitionDescription { // Result for describe topic request. struct TDescribeTopicResult : public TStatus { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; TDescribeTopicResult(TStatus&& status, Ydb::Topic::DescribeTopicResult&& result); @@ -367,7 +367,7 @@ struct TDescribeTopicResult : public TStatus { // Result for describe consumer request. struct TDescribeConsumerResult : public TStatus { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; TDescribeConsumerResult(TStatus&& status, Ydb::Topic::DescribeConsumerResult&& result); @@ -379,7 +379,7 @@ struct TDescribeConsumerResult : public TStatus { // Result for describe partition request. struct TDescribePartitionResult: public TStatus { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; TDescribePartitionResult(TStatus&& status, Ydb::Topic::DescribePartitionResult&& result); @@ -750,4 +750,4 @@ struct TDescribePartitionSettings: public TOperationRequestSettings {}; -} // namespace NYdb::NTopic +} // namespace NYdb::V3::NTopic diff --git a/include/ydb-cpp-sdk/client/topic/counters.h b/include/ydb-cpp-sdk/client/topic/counters.h index 8d44dc131c..69568c3e17 100644 --- a/include/ydb-cpp-sdk/client/topic/counters.h +++ b/include/ydb-cpp-sdk/client/topic/counters.h @@ -2,7 +2,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { using TCounterPtr = ::NMonitoring::TDynamicCounters::TCounterPtr; @@ -169,4 +169,4 @@ inline bool HasNullCounters(TReaderCounters& counters) { #undef TOPIC_COUNTERS_HISTOGRAM_SETUP -} // namespace NYdb::NTopic +} // namespace NYdb::V3::NTopic diff --git a/include/ydb-cpp-sdk/client/topic/errors.h b/include/ydb-cpp-sdk/client/topic/errors.h index e8790061c7..e36a820fe1 100644 --- a/include/ydb-cpp-sdk/client/topic/errors.h +++ b/include/ydb-cpp-sdk/client/topic/errors.h @@ -5,9 +5,9 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { ERetryErrorClass GetRetryErrorClass(EStatus status); ERetryErrorClass GetRetryErrorClassV2(EStatus status); -} // namespace NYdb::NTopic +} // namespace NYdb::V3::NTopic diff --git a/include/ydb-cpp-sdk/client/topic/events_common.h b/include/ydb-cpp-sdk/client/topic/events_common.h index 384bc43523..0755659241 100644 --- a/include/ydb-cpp-sdk/client/topic/events_common.h +++ b/include/ydb-cpp-sdk/client/topic/events_common.h @@ -5,7 +5,7 @@ #include #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { template class TPrintable { diff --git a/include/ydb-cpp-sdk/client/topic/executor.h b/include/ydb-cpp-sdk/client/topic/executor.h index 23484dc79a..cb9201d3c6 100644 --- a/include/ydb-cpp-sdk/client/topic/executor.h +++ b/include/ydb-cpp-sdk/client/topic/executor.h @@ -7,7 +7,7 @@ #include #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { class IExecutor: public TThrRefBase { public: diff --git a/include/ydb-cpp-sdk/client/topic/read_events.h b/include/ydb-cpp-sdk/client/topic/read_events.h index cf967edf1e..81f0d88dd1 100644 --- a/include/ydb-cpp-sdk/client/topic/read_events.h +++ b/include/ydb-cpp-sdk/client/topic/read_events.h @@ -5,7 +5,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { //! Partition session. struct TPartitionSession: public TThrRefBase, public TPrintable { diff --git a/include/ydb-cpp-sdk/client/topic/read_session.h b/include/ydb-cpp-sdk/client/topic/read_session.h index 889850417f..696d3f01f0 100644 --- a/include/ydb-cpp-sdk/client/topic/read_session.h +++ b/include/ydb-cpp-sdk/client/topic/read_session.h @@ -13,11 +13,11 @@ #include -namespace NYdb::NTable { +namespace NYdb::inline V3::NTable { class TTransaction; } -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { //! Read settings for single topic. struct TTopicReadSettings { diff --git a/include/ydb-cpp-sdk/client/topic/retry_policy.h b/include/ydb-cpp-sdk/client/topic/retry_policy.h index 8aef9f3556..3460a5659e 100644 --- a/include/ydb-cpp-sdk/client/topic/retry_policy.h +++ b/include/ydb-cpp-sdk/client/topic/retry_policy.h @@ -4,7 +4,7 @@ #include #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { //! Retry policy. //! Calculates delay before next retry. @@ -38,4 +38,4 @@ struct IRetryPolicy: ::IRetryPolicy { std::function customRetryClassFunction = {}); }; -} // namespace NYdb::NTopic +} // namespace NYdb::V3::NTopic diff --git a/include/ydb-cpp-sdk/client/topic/write_events.h b/include/ydb-cpp-sdk/client/topic/write_events.h index 46d195f688..49b7bb1ded 100644 --- a/include/ydb-cpp-sdk/client/topic/write_events.h +++ b/include/ydb-cpp-sdk/client/topic/write_events.h @@ -7,7 +7,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { struct TWriteStat : public TThrRefBase { TDuration WriteTime; diff --git a/include/ydb-cpp-sdk/client/topic/write_session.h b/include/ydb-cpp-sdk/client/topic/write_session.h index 45e995a235..585e32f13c 100644 --- a/include/ydb-cpp-sdk/client/topic/write_session.h +++ b/include/ydb-cpp-sdk/client/topic/write_session.h @@ -11,11 +11,11 @@ #include -namespace NYdb::NTable { +namespace NYdb::inline V3::NTable { class TTransaction; } -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { using TTransaction = NTable::TTransaction; diff --git a/include/ydb-cpp-sdk/client/types/credentials/credentials.h b/include/ydb-cpp-sdk/client/types/credentials/credentials.h index b858888cf6..a70dbeeb0b 100644 --- a/include/ydb-cpp-sdk/client/types/credentials/credentials.h +++ b/include/ydb-cpp-sdk/client/types/credentials/credentials.h @@ -3,7 +3,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { class ICredentialsProvider { public: diff --git a/include/ydb-cpp-sdk/client/types/credentials/oauth2_token_exchange/credentials.h b/include/ydb-cpp-sdk/client/types/credentials/oauth2_token_exchange/credentials.h index 3c6017cb71..e0593ab06e 100644 --- a/include/ydb-cpp-sdk/client/types/credentials/oauth2_token_exchange/credentials.h +++ b/include/ydb-cpp-sdk/client/types/credentials/oauth2_token_exchange/credentials.h @@ -7,7 +7,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { class ITokenSource { public: diff --git a/include/ydb-cpp-sdk/client/types/credentials/oauth2_token_exchange/from_file.h b/include/ydb-cpp-sdk/client/types/credentials/oauth2_token_exchange/from_file.h index b887cca588..621425d47e 100644 --- a/include/ydb-cpp-sdk/client/types/credentials/oauth2_token_exchange/from_file.h +++ b/include/ydb-cpp-sdk/client/types/credentials/oauth2_token_exchange/from_file.h @@ -5,7 +5,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { // Lists supported algorithms for creation of OAuth 2.0 token exchange provider via config file std::vector GetSupportedOauth2TokenExchangeJwtAlgorithms(); diff --git a/include/ydb-cpp-sdk/client/types/credentials/oauth2_token_exchange/jwt_token_source.h b/include/ydb-cpp-sdk/client/types/credentials/oauth2_token_exchange/jwt_token_source.h index 674203eb3c..0660708e72 100644 --- a/include/ydb-cpp-sdk/client/types/credentials/oauth2_token_exchange/jwt_token_source.h +++ b/include/ydb-cpp-sdk/client/types/credentials/oauth2_token_exchange/jwt_token_source.h @@ -6,7 +6,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { constexpr TDuration DEFAULT_JWT_TOKEN_TTL = TDuration::Hours(1); diff --git a/include/ydb-cpp-sdk/client/types/exceptions/exceptions.h b/include/ydb-cpp-sdk/client/types/exceptions/exceptions.h index cd3c51bb85..b296db2429 100644 --- a/include/ydb-cpp-sdk/client/types/exceptions/exceptions.h +++ b/include/ydb-cpp-sdk/client/types/exceptions/exceptions.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { class TYdbException : public yexception { public: diff --git a/include/ydb-cpp-sdk/client/types/fatal_error_handlers/handlers.h b/include/ydb-cpp-sdk/client/types/fatal_error_handlers/handlers.h index a931b80700..a36e083895 100644 --- a/include/ydb-cpp-sdk/client/types/fatal_error_handlers/handlers.h +++ b/include/ydb-cpp-sdk/client/types/fatal_error_handlers/handlers.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { void ThrowFatalError(const std::string& str); diff --git a/include/ydb-cpp-sdk/client/types/operation/operation.h b/include/ydb-cpp-sdk/client/types/operation/operation.h index 88d226d2aa..893a5f4ebc 100644 --- a/include/ydb-cpp-sdk/client/types/operation/operation.h +++ b/include/ydb-cpp-sdk/client/types/operation/operation.h @@ -16,7 +16,7 @@ class Operation; } // namespace Operations } // namespace Ydb -namespace NYdb { +namespace NYdb::inline V3 { class TStatus; diff --git a/include/ydb-cpp-sdk/client/types/request_settings.h b/include/ydb-cpp-sdk/client/types/request_settings.h index 9543616ca5..d62730bcb9 100644 --- a/include/ydb-cpp-sdk/client/types/request_settings.h +++ b/include/ydb-cpp-sdk/client/types/request_settings.h @@ -7,7 +7,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { template struct TRequestSettings { diff --git a/include/ydb-cpp-sdk/client/types/s3_settings.h b/include/ydb-cpp-sdk/client/types/s3_settings.h index 66cb153041..6f5430a5fe 100644 --- a/include/ydb-cpp-sdk/client/types/s3_settings.h +++ b/include/ydb-cpp-sdk/client/types/s3_settings.h @@ -4,7 +4,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { enum class ES3Scheme { HTTP = 1 /* "http" */, diff --git a/include/ydb-cpp-sdk/client/types/status/status.h b/include/ydb-cpp-sdk/client/types/status/status.h index d95feeb51a..1f8dceb43b 100644 --- a/include/ydb-cpp-sdk/client/types/status/status.h +++ b/include/ydb-cpp-sdk/client/types/status/status.h @@ -7,7 +7,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { //! Internal status representation struct TPlainStatus; diff --git a/include/ydb-cpp-sdk/client/types/status_codes.h b/include/ydb-cpp-sdk/client/types/status_codes.h index d6c34651e2..15aedc57b7 100644 --- a/include/ydb-cpp-sdk/client/types/status_codes.h +++ b/include/ydb-cpp-sdk/client/types/status_codes.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { constexpr size_t TRANSPORT_STATUSES_FIRST = 401000; constexpr size_t TRANSPORT_STATUSES_LAST = 401999; diff --git a/include/ydb-cpp-sdk/client/types/ydb.h b/include/ydb-cpp-sdk/client/types/ydb.h index 2321d94c2a..e0c85f8b65 100644 --- a/include/ydb-cpp-sdk/client/types/ydb.h +++ b/include/ydb-cpp-sdk/client/types/ydb.h @@ -2,7 +2,7 @@ #include "status_codes.h" -namespace NYdb { +namespace NYdb::inline V3 { enum class EDiscoveryMode { //! Block in ctor (driver or client if database and/or auth token is overridden by client settings) diff --git a/include/ydb-cpp-sdk/client/value/value.h b/include/ydb-cpp-sdk/client/value/value.h index c9f300adea..f198d54f68 100644 --- a/include/ydb-cpp-sdk/client/value/value.h +++ b/include/ydb-cpp-sdk/client/value/value.h @@ -10,7 +10,7 @@ namespace Ydb { class Value; } -namespace NYdb { +namespace NYdb::inline V3 { class TResultSetParser; diff --git a/src/api/protos/ydb_cms.proto b/src/api/protos/ydb_cms.proto index 29e8b3f596..806bb63bb5 100644 --- a/src/api/protos/ydb_cms.proto +++ b/src/api/protos/ydb_cms.proto @@ -4,6 +4,7 @@ option cc_enable_arenas = true; package Ydb.Cms; option java_package = "com.yandex.ydb.cms"; +import "src/api/protos/annotations/validation.proto"; import "src/api/protos/ydb_issue_message.proto"; import "src/api/protos/ydb_operation.proto"; import "src/api/protos/ydb_status_codes.proto"; @@ -115,7 +116,7 @@ message ScaleRecommenderPolicies { message TargetTrackingPolicy { oneof target { // A percentage of compute resources' average CPU utilization. - uint32 average_cpu_utilization_percent = 1; + uint32 average_cpu_utilization_percent = 1 [(Ydb.value) = "[10; 90]"]; } } diff --git a/src/client/common_client/impl/client.h b/src/client/common_client/impl/client.h index 41cee29a98..a24667204c 100644 --- a/src/client/common_client/impl/client.h +++ b/src/client/common_client/impl/client.h @@ -11,7 +11,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { template class TClientImplCommon diff --git a/src/client/common_client/impl/iface.h b/src/client/common_client/impl/iface.h index 2f0e310599..87b6ad6472 100644 --- a/src/client/common_client/impl/iface.h +++ b/src/client/common_client/impl/iface.h @@ -3,7 +3,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { class IClientImplCommon { public: diff --git a/src/client/common_client/settings.cpp b/src/client/common_client/settings.cpp index 166b139b52..d8928a566f 100644 --- a/src/client/common_client/settings.cpp +++ b/src/client/common_client/settings.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { TCommonClientSettings& TCommonClientSettings::AuthToken(const std::optional& token) { return CredentialsProviderFactory(CreateOAuthCredentialsProviderFactory(token.value())); diff --git a/src/client/coordination/coordination.cpp b/src/client/coordination/coordination.cpp index 1fba2be26b..f141a58a7e 100644 --- a/src/client/coordination/coordination.cpp +++ b/src/client/coordination/coordination.cpp @@ -11,7 +11,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NCoordination { using NThreading::TFuture; diff --git a/src/client/coordination/proto_accessor.cpp b/src/client/coordination/proto_accessor.cpp index de2ebf8370..c6a1051d42 100644 --- a/src/client/coordination/proto_accessor.cpp +++ b/src/client/coordination/proto_accessor.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { const Ydb::Coordination::DescribeNodeResult& TProtoAccessor::GetProto(const NCoordination::TNodeDescription& nodeDescription) { return nodeDescription.GetProto(); diff --git a/src/client/datastreams/datastreams.cpp b/src/client/datastreams/datastreams.cpp index 31cfdea4ca..d7c571ef67 100644 --- a/src/client/datastreams/datastreams.cpp +++ b/src/client/datastreams/datastreams.cpp @@ -11,7 +11,7 @@ #include -namespace NYdb::NDataStreams::V1 { +namespace NYdb::inline V3::NDataStreams::V1 { TPartitioningSettingsBuilder TCreateStreamSettings::BeginConfigurePartitioningSettings() { return { *this }; diff --git a/src/client/debug/client.cpp b/src/client/debug/client.cpp index 383d6e7737..e3542e3633 100644 --- a/src/client/debug/client.cpp +++ b/src/client/debug/client.cpp @@ -10,7 +10,7 @@ #include -namespace NYdb::NDebug { +namespace NYdb::inline V3::NDebug { using namespace Ydb; diff --git a/src/client/discovery/discovery.cpp b/src/client/discovery/discovery.cpp index 2295886e5c..c3c97d435f 100644 --- a/src/client/discovery/discovery.cpp +++ b/src/client/discovery/discovery.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NDiscovery { TListEndpointsResult::TListEndpointsResult(TStatus&& status, const Ydb::Discovery::ListEndpointsResult& proto) diff --git a/src/client/draft/ydb_dynamic_config.cpp b/src/client/draft/ydb_dynamic_config.cpp index aab5d7b5d4..315bbe3ade 100644 --- a/src/client/draft/ydb_dynamic_config.cpp +++ b/src/client/draft/ydb_dynamic_config.cpp @@ -4,7 +4,7 @@ #include #include -namespace NYdb::NDynamicConfig { +namespace NYdb::inline V3::NDynamicConfig { class TDynamicConfigClient::TImpl : public TClientImplCommon { public: @@ -431,4 +431,4 @@ TAsyncVerboseResolveConfigResult TDynamicConfigClient::VerboseResolveConfig( return Impl_->VerboseResolveConfig(config, volatileConfigs, settings); } -} // namespace NYdb::NDynamicConfig +} // namespace NYdb::V3::NDynamicConfig diff --git a/src/client/draft/ydb_replication.cpp b/src/client/draft/ydb_replication.cpp index ced4698419..66e5a00107 100644 --- a/src/client/draft/ydb_replication.cpp +++ b/src/client/draft/ydb_replication.cpp @@ -13,7 +13,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NReplication { TConnectionParams::TConnectionParams(const Ydb::Replication::ConnectionParams& params) { diff --git a/src/client/draft/ydb_scripting.cpp b/src/client/draft/ydb_scripting.cpp index 8c99a857d7..e785b31836 100644 --- a/src/client/draft/ydb_scripting.cpp +++ b/src/client/draft/ydb_scripting.cpp @@ -9,7 +9,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NScripting { using namespace NThreading; diff --git a/src/client/draft/ydb_view.cpp b/src/client/draft/ydb_view.cpp index 1afd5440bf..75fa55606b 100644 --- a/src/client/draft/ydb_view.cpp +++ b/src/client/draft/ydb_view.cpp @@ -9,7 +9,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NView { TViewDescription::TViewDescription(const Ydb::View::DescribeViewResult& desc) diff --git a/src/client/driver/driver.cpp b/src/client/driver/driver.cpp index 009852d563..af4e96a277 100644 --- a/src/client/driver/driver.cpp +++ b/src/client/driver/driver.cpp @@ -13,7 +13,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { using NYdbGrpc::TGRpcClientLow; using NYdbGrpc::TServiceConnection; diff --git a/src/client/export/export.cpp b/src/client/export/export.cpp index 8760903181..bbff6e1020 100644 --- a/src/client/export/export.cpp +++ b/src/client/export/export.cpp @@ -15,7 +15,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NExport { using namespace NThreading; diff --git a/src/client/extension_common/extension.cpp b/src/client/extension_common/extension.cpp index db0dc29b46..5ad050e1d1 100644 --- a/src/client/extension_common/extension.cpp +++ b/src/client/extension_common/extension.cpp @@ -5,7 +5,7 @@ #include #undef INCLUDE_YDB_INTERNAL_H -namespace NYdb { +namespace NYdb::inline V3 { void IExtension::SelfRegister(TDriver driver) { CreateInternalInterface(driver)->RegisterExtension(this); diff --git a/src/client/extensions/solomon_stats/pull_client.cpp b/src/client/extensions/solomon_stats/pull_client.cpp index 742d09d4a5..fbb6129061 100644 --- a/src/client/extensions/solomon_stats/pull_client.cpp +++ b/src/client/extensions/solomon_stats/pull_client.cpp @@ -1,6 +1,6 @@ #include -namespace NSolomonStatExtension { +namespace NSolomonStatExtension::inline V3 { TSolomonStatPullExtension::TParams::TParams(const std::string& host , ui16 port diff --git a/src/client/federated_topic/impl/federated_read_session.cpp b/src/client/federated_topic/impl/federated_read_session.cpp index 30c85ac9d3..90343c3d46 100644 --- a/src/client/federated_topic/impl/federated_read_session.cpp +++ b/src/client/federated_topic/impl/federated_read_session.cpp @@ -11,7 +11,7 @@ #include #include -namespace NYdb::NFederatedTopic { +namespace NYdb::inline V3::NFederatedTopic { NTopic::TTopicClientSettings FromFederated(const TFederatedTopicClientSettings& settings); @@ -288,4 +288,4 @@ bool TFederatedReadSessionImpl::Close(TDuration timeout) { return result; } -} // namespace NYdb::NFederatedTopic +} // namespace NYdb::V3::NFederatedTopic diff --git a/src/client/federated_topic/impl/federated_read_session.h b/src/client/federated_topic/impl/federated_read_session.h index e01b58c782..9b7d4cf9a6 100644 --- a/src/client/federated_topic/impl/federated_read_session.h +++ b/src/client/federated_topic/impl/federated_read_session.h @@ -7,7 +7,7 @@ #include -namespace NYdb::NFederatedTopic { +namespace NYdb::inline V3::NFederatedTopic { class TEventFederator { public: @@ -246,4 +246,4 @@ class TFederatedReadSession : public IFederatedReadSession, } }; -} // namespace NYdb::NFederatedTopic +} // namespace NYdb::V3::NFederatedTopic diff --git a/src/client/federated_topic/impl/federated_read_session_event.cpp b/src/client/federated_topic/impl/federated_read_session_event.cpp index 150345472c..5c54f02570 100644 --- a/src/client/federated_topic/impl/federated_read_session_event.cpp +++ b/src/client/federated_topic/impl/federated_read_session_event.cpp @@ -4,7 +4,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Printable specializations -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { using namespace NFederatedTopic; @@ -135,7 +135,7 @@ void TPrintable::DebugString(TStringBuilder& ret, bool print } -namespace NYdb::NFederatedTopic { +namespace NYdb::inline V3::NFederatedTopic { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NFederatedTopic::TReadSessionEvent::TDataReceivedEvent @@ -165,4 +165,4 @@ std::string DebugString(const TReadSessionEvent::TEvent& event) { return std::visit([](const auto& ev) { return ev.DebugString(); }, event); } -} // namespace NYdb::NFederatedTopic +} // namespace NYdb::V3::NFederatedTopic diff --git a/src/client/federated_topic/impl/federated_topic.cpp b/src/client/federated_topic/impl/federated_topic.cpp index e0f37d9d35..f74e05e384 100644 --- a/src/client/federated_topic/impl/federated_topic.cpp +++ b/src/client/federated_topic/impl/federated_topic.cpp @@ -1,7 +1,7 @@ #include #include -namespace NYdb::NFederatedTopic { +namespace NYdb::inline V3::NFederatedTopic { // TFederatedReadSessionSettings // Read policy settings @@ -86,4 +86,4 @@ void TFederatedTopicClient::OverrideCodec(NTopic::ECodec codecId, std::unique_pt return Impl_->OverrideCodec(codecId, std::move(codecImpl)); } -} // namespace NYdb::NFederatedTopic +} // namespace NYdb::V3::NFederatedTopic diff --git a/src/client/federated_topic/impl/federated_topic_impl.cpp b/src/client/federated_topic/impl/federated_topic_impl.cpp index 4cf28a6212..4a1384800e 100644 --- a/src/client/federated_topic/impl/federated_topic_impl.cpp +++ b/src/client/federated_topic/impl/federated_topic_impl.cpp @@ -3,7 +3,7 @@ #include "federated_read_session.h" #include "federated_write_session.h" -namespace NYdb::NFederatedTopic { +namespace NYdb::inline V3::NFederatedTopic { std::shared_ptr TFederatedTopicClient::TImpl::CreateReadSession(const TFederatedReadSessionSettings& settings) { diff --git a/src/client/federated_topic/impl/federated_topic_impl.h b/src/client/federated_topic/impl/federated_topic_impl.h index 3c52904fbb..73be8e544e 100644 --- a/src/client/federated_topic/impl/federated_topic_impl.h +++ b/src/client/federated_topic/impl/federated_topic_impl.h @@ -12,7 +12,7 @@ #include #include -namespace NYdb::NFederatedTopic { +namespace NYdb::inline V3::NFederatedTopic { class TFederatedTopicClient::TImpl { public: @@ -89,4 +89,4 @@ class TFederatedTopicClient::TImpl { TAdaptiveLock Lock; }; -} // namespace NYdb::NFederatedTopic +} // namespace NYdb::V3::NFederatedTopic diff --git a/src/client/federated_topic/impl/federated_write_session.cpp b/src/client/federated_topic/impl/federated_write_session.cpp index cb4bbba85c..5d6b312fc6 100644 --- a/src/client/federated_topic/impl/federated_write_session.cpp +++ b/src/client/federated_topic/impl/federated_write_session.cpp @@ -11,7 +11,7 @@ #include -namespace NYdb::NFederatedTopic { +namespace NYdb::inline V3::NFederatedTopic { constexpr TDuration UPDATE_FEDERATION_STATE_DELAY = TDuration::Seconds(10); @@ -467,4 +467,4 @@ bool TFederatedWriteSessionImpl::Close(TDuration timeout) { } } -} // namespace NYdb::NFederatedTopic +} // namespace NYdb::V3::NFederatedTopic diff --git a/src/client/federated_topic/impl/federated_write_session.h b/src/client/federated_topic/impl/federated_write_session.h index 878503b6e8..670558d69f 100644 --- a/src/client/federated_topic/impl/federated_write_session.h +++ b/src/client/federated_topic/impl/federated_write_session.h @@ -6,7 +6,7 @@ #include -namespace NYdb::NFederatedTopic { +namespace NYdb::inline V3::NFederatedTopic { std::pair, EStatus> SelectDatabaseByHashImpl( NTopic::TFederatedWriteSessionSettings const& settings, @@ -206,4 +206,4 @@ class TFederatedWriteSession : public NTopic::IWriteSession, } }; -} // namespace NYdb::NFederatedTopic +} // namespace NYdb::V3::NFederatedTopic diff --git a/src/client/federated_topic/impl/federation_observer.cpp b/src/client/federated_topic/impl/federation_observer.cpp index a87d486396..7d720c785a 100644 --- a/src/client/federated_topic/impl/federation_observer.cpp +++ b/src/client/federated_topic/impl/federation_observer.cpp @@ -3,7 +3,7 @@ #include -namespace NYdb::NFederatedTopic { +namespace NYdb::inline V3::NFederatedTopic { constexpr TDuration REDISCOVERY_DELAY = TDuration::Seconds(30); @@ -200,4 +200,4 @@ IOutputStream& operator<<(IOutputStream& out, TFederatedDbState const& state) { return out << " }"; } -} // namespace NYdb::NFederatedTopic +} // namespace NYdb::V3::NFederatedTopic diff --git a/src/client/federated_topic/impl/federation_observer.h b/src/client/federated_topic/impl/federation_observer.h index e35c1d858d..84e6cf1694 100644 --- a/src/client/federated_topic/impl/federation_observer.h +++ b/src/client/federated_topic/impl/federation_observer.h @@ -16,7 +16,7 @@ #include #include -namespace NYdb::NFederatedTopic { +namespace NYdb::inline V3::NFederatedTopic { struct TFederatedDbState { public: @@ -121,4 +121,4 @@ class TFederatedDbObserver : public NTopic::TContextOwner -namespace NYdb { +namespace NYdb::inline V3 { TDriverConfig CreateFromEnvironment(const std::string& connectionString) { TDriverConfig driverConfig; diff --git a/src/client/iam/common/iam.h b/src/client/iam/common/iam.h index 91ec93674e..c7f7742c5a 100644 --- a/src/client/iam/common/iam.h +++ b/src/client/iam/common/iam.h @@ -9,7 +9,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { constexpr TDuration BACKOFF_START = TDuration::MilliSeconds(50); constexpr TDuration BACKOFF_MAX = TDuration::Seconds(10); diff --git a/src/client/iam/iam.cpp b/src/client/iam/iam.cpp index 032de620a6..b3f7c59c87 100644 --- a/src/client/iam/iam.cpp +++ b/src/client/iam/iam.cpp @@ -10,7 +10,7 @@ using namespace yandex::cloud::iam::v1; -namespace NYdb { +namespace NYdb::inline V3 { class TIAMCredentialsProvider : public ICredentialsProvider { public: diff --git a/src/client/iam_private/iam.cpp b/src/client/iam_private/iam.cpp index 5a36b4cbc7..294f8cc65d 100644 --- a/src/client/iam_private/iam.cpp +++ b/src/client/iam_private/iam.cpp @@ -5,7 +5,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { TCredentialsProviderFactoryPtr CreateIamJwtCredentialsProviderFactoryImplPrivate(TIamJwtParams&& jwtParams) { return std::make_shared #include -namespace NYdb { +namespace NYdb::inline V3 { using std::string; diff --git a/src/client/impl/ydb_endpoints/endpoints.h b/src/client/impl/ydb_endpoints/endpoints.h index b358d98158..ec6225311e 100644 --- a/src/client/impl/ydb_endpoints/endpoints.h +++ b/src/client/impl/ydb_endpoints/endpoints.h @@ -7,7 +7,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { struct TEndpointRecord { std::string Endpoint; diff --git a/src/client/impl/ydb_internal/common/client_pid.cpp b/src/client/impl/ydb_internal/common/client_pid.cpp index 91f091d7ed..ec82d6b613 100644 --- a/src/client/impl/ydb_internal/common/client_pid.cpp +++ b/src/client/impl/ydb_internal/common/client_pid.cpp @@ -13,7 +13,7 @@ #include #endif -namespace NYdb { +namespace NYdb::inline V3 { namespace { ui32 GetProcessId() { diff --git a/src/client/impl/ydb_internal/common/client_pid.h b/src/client/impl/ydb_internal/common/client_pid.h index dcfae5e61c..b8136e16c0 100644 --- a/src/client/impl/ydb_internal/common/client_pid.h +++ b/src/client/impl/ydb_internal/common/client_pid.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { std::string GetClientPIDHeaderValue(); diff --git a/src/client/impl/ydb_internal/common/getenv.cpp b/src/client/impl/ydb_internal/common/getenv.cpp index e752851abc..d6d136dbd7 100644 --- a/src/client/impl/ydb_internal/common/getenv.cpp +++ b/src/client/impl/ydb_internal/common/getenv.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { std::string GetStrFromEnv(const char* envVarName, const std::string& defaultValue) { auto envVarPointer = getenv(envVarName); diff --git a/src/client/impl/ydb_internal/common/getenv.h b/src/client/impl/ydb_internal/common/getenv.h index 8c9453b129..b105bf5e94 100644 --- a/src/client/impl/ydb_internal/common/getenv.h +++ b/src/client/impl/ydb_internal/common/getenv.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { std::string GetStrFromEnv(const char* envVarName, const std::string& defaultValue = ""); diff --git a/src/client/impl/ydb_internal/common/parser.cpp b/src/client/impl/ydb_internal/common/parser.cpp index e4c3c2c20c..879048743c 100644 --- a/src/client/impl/ydb_internal/common/parser.cpp +++ b/src/client/impl/ydb_internal/common/parser.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { TConnectionInfo ParseConnectionString(const std::string& connectionString) { if (connectionString.length() == 0) { diff --git a/src/client/impl/ydb_internal/common/parser.h b/src/client/impl/ydb_internal/common/parser.h index 7c281cb21e..13df795e6a 100644 --- a/src/client/impl/ydb_internal/common/parser.h +++ b/src/client/impl/ydb_internal/common/parser.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { struct TConnectionInfo { std::string Endpoint = ""; diff --git a/src/client/impl/ydb_internal/common/types.h b/src/client/impl/ydb_internal/common/types.h index 4c18d46221..7deb54f511 100644 --- a/src/client/impl/ydb_internal/common/types.h +++ b/src/client/impl/ydb_internal/common/types.h @@ -10,7 +10,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { // Other callbacks using TSimpleCb = std::function; diff --git a/src/client/impl/ydb_internal/db_driver_state/authenticator.cpp b/src/client/impl/ydb_internal/db_driver_state/authenticator.cpp index 38160fba2e..c0bfce96e0 100644 --- a/src/client/impl/ydb_internal/db_driver_state/authenticator.cpp +++ b/src/client/impl/ydb_internal/db_driver_state/authenticator.cpp @@ -3,7 +3,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { TYdbAuthenticator::TYdbAuthenticator(std::shared_ptr credentialsProvider) : CredentialsProvider_(std::move(credentialsProvider)) diff --git a/src/client/impl/ydb_internal/db_driver_state/authenticator.h b/src/client/impl/ydb_internal/db_driver_state/authenticator.h index 9254093930..ff0ecb0fb2 100644 --- a/src/client/impl/ydb_internal/db_driver_state/authenticator.h +++ b/src/client/impl/ydb_internal/db_driver_state/authenticator.h @@ -6,7 +6,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { class TYdbAuthenticator : public grpc::MetadataCredentialsPlugin { public: diff --git a/src/client/impl/ydb_internal/db_driver_state/endpoint_pool.cpp b/src/client/impl/ydb_internal/db_driver_state/endpoint_pool.cpp index 49946489be..50432a49bc 100644 --- a/src/client/impl/ydb_internal/db_driver_state/endpoint_pool.cpp +++ b/src/client/impl/ydb_internal/db_driver_state/endpoint_pool.cpp @@ -1,7 +1,7 @@ #define INCLUDE_YDB_INTERNAL_H #include "endpoint_pool.h" -namespace NYdb { +namespace NYdb::inline V3 { using std::string; using std::vector; diff --git a/src/client/impl/ydb_internal/db_driver_state/endpoint_pool.h b/src/client/impl/ydb_internal/db_driver_state/endpoint_pool.h index 638105469d..ac5e57993f 100644 --- a/src/client/impl/ydb_internal/db_driver_state/endpoint_pool.h +++ b/src/client/impl/ydb_internal/db_driver_state/endpoint_pool.h @@ -11,7 +11,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { struct TListEndpointsResult { Ydb::Discovery::ListEndpointsResult Result; diff --git a/src/client/impl/ydb_internal/db_driver_state/state.cpp b/src/client/impl/ydb_internal/db_driver_state/state.cpp index 05affd18c0..76f94af60c 100644 --- a/src/client/impl/ydb_internal/db_driver_state/state.cpp +++ b/src/client/impl/ydb_internal/db_driver_state/state.cpp @@ -18,7 +18,7 @@ namespace { } } -namespace NYdb { +namespace NYdb::inline V3 { constexpr int PESSIMIZATION_DISCOVERY_THRESHOLD = 50; // percent of endpoints pessimized by transport error to start recheck constexpr TDuration ENDPOINT_UPDATE_PERIOD = TDuration::Minutes(1); // period to perform endpoints update in "normal" case diff --git a/src/client/impl/ydb_internal/db_driver_state/state.h b/src/client/impl/ydb_internal/db_driver_state/state.h index bf81784dd2..ad2ff25b8f 100644 --- a/src/client/impl/ydb_internal/db_driver_state/state.h +++ b/src/client/impl/ydb_internal/db_driver_state/state.h @@ -8,7 +8,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { class ICredentialsProvider; class ICredentialsProviderFactory; diff --git a/src/client/impl/ydb_internal/driver/constants.h b/src/client/impl/ydb_internal/driver/constants.h index 19d2246ac2..3b51aa92c0 100644 --- a/src/client/impl/ydb_internal/driver/constants.h +++ b/src/client/impl/ydb_internal/driver/constants.h @@ -4,7 +4,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { constexpr uint64_t TCP_KEEPALIVE_IDLE = 30; // The time the connection needs to remain idle // before TCP starts sending keepalive probes, seconds diff --git a/src/client/impl/ydb_internal/grpc_connections/actions.cpp b/src/client/impl/ydb_internal/grpc_connections/actions.cpp index 0be7ef9fa9..196f40d38f 100644 --- a/src/client/impl/ydb_internal/grpc_connections/actions.cpp +++ b/src/client/impl/ydb_internal/grpc_connections/actions.cpp @@ -4,7 +4,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { constexpr TDuration MAX_DEFERRED_CALL_DELAY = TDuration::Seconds(10); // The max delay between GetOperation calls for one operation diff --git a/src/client/impl/ydb_internal/grpc_connections/actions.h b/src/client/impl/ydb_internal/grpc_connections/actions.h index 20150d7c25..b95f78ce62 100644 --- a/src/client/impl/ydb_internal/grpc_connections/actions.h +++ b/src/client/impl/ydb_internal/grpc_connections/actions.h @@ -13,7 +13,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { using NYdbGrpc::IQueueClientContext; using NYdbGrpc::IQueueClientEvent; diff --git a/src/client/impl/ydb_internal/grpc_connections/grpc_connections.cpp b/src/client/impl/ydb_internal/grpc_connections/grpc_connections.cpp index 3ecf2d3fb4..a3eba4dc8a 100644 --- a/src/client/impl/ydb_internal/grpc_connections/grpc_connections.cpp +++ b/src/client/impl/ydb_internal/grpc_connections/grpc_connections.cpp @@ -3,7 +3,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { bool IsTokenCorrect(const std::string& in) { for (char c : in) { diff --git a/src/client/impl/ydb_internal/grpc_connections/grpc_connections.h b/src/client/impl/ydb_internal/grpc_connections/grpc_connections.h index 30ba3e1d65..3eeb79af21 100644 --- a/src/client/impl/ydb_internal/grpc_connections/grpc_connections.h +++ b/src/client/impl/ydb_internal/grpc_connections/grpc_connections.h @@ -16,7 +16,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { constexpr TDuration GRPC_KEEP_ALIVE_TIMEOUT_FOR_DISCOVERY = TDuration::Seconds(10); constexpr TDuration INITIAL_DEFERRED_CALL_DELAY = TDuration::MilliSeconds(10); // The delay before first deferred service call diff --git a/src/client/impl/ydb_internal/grpc_connections/params.h b/src/client/impl/ydb_internal/grpc_connections/params.h index 5672ec2bf4..b0670a8e48 100644 --- a/src/client/impl/ydb_internal/grpc_connections/params.h +++ b/src/client/impl/ydb_internal/grpc_connections/params.h @@ -7,7 +7,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { class IConnectionsParams { public: diff --git a/src/client/impl/ydb_internal/internal_client/client.h b/src/client/impl/ydb_internal/internal_client/client.h index ff5327bd3a..b40003b507 100644 --- a/src/client/impl/ydb_internal/internal_client/client.h +++ b/src/client/impl/ydb_internal/internal_client/client.h @@ -14,7 +14,7 @@ namespace NMonitoring { class TMetricRegistry; } -namespace NYdb { +namespace NYdb::inline V3 { class TDbDriverState; struct TListEndpointsResult; diff --git a/src/client/impl/ydb_internal/kqp_session_common/kqp_session_common.cpp b/src/client/impl/ydb_internal/kqp_session_common/kqp_session_common.cpp index 8353f4c0b6..299f3f0245 100644 --- a/src/client/impl/ydb_internal/kqp_session_common/kqp_session_common.cpp +++ b/src/client/impl/ydb_internal/kqp_session_common/kqp_session_common.cpp @@ -3,7 +3,8 @@ #include #include -namespace NYdb { + +namespace NYdb::inline V3 { using std::string; diff --git a/src/client/impl/ydb_internal/kqp_session_common/kqp_session_common.h b/src/client/impl/ydb_internal/kqp_session_common/kqp_session_common.h index daa13caefe..6256c23e7e 100644 --- a/src/client/impl/ydb_internal/kqp_session_common/kqp_session_common.h +++ b/src/client/impl/ydb_internal/kqp_session_common/kqp_session_common.h @@ -8,7 +8,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { //////////////////////////////////////////////////////////////////////////////// ui64 GetNodeIdFromSession(const std::string& sessionId); diff --git a/src/client/impl/ydb_internal/logger/log.cpp b/src/client/impl/ydb_internal/logger/log.cpp index 1b9ae0c7bf..f8a8dcbcaf 100644 --- a/src/client/impl/ydb_internal/logger/log.cpp +++ b/src/client/impl/ydb_internal/logger/log.cpp @@ -6,7 +6,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { static const std::string_view LogPrioritiesStrings[] = { " :EMERG: ", diff --git a/src/client/impl/ydb_internal/logger/log.h b/src/client/impl/ydb_internal/logger/log.h index ace543504e..1a4c6e19f4 100644 --- a/src/client/impl/ydb_internal/logger/log.h +++ b/src/client/impl/ydb_internal/logger/log.h @@ -4,7 +4,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { TLogFormatter GetPrefixLogFormatter(const std::string& prefix); std::string GetDatabaseLogPrefix(const std::string& database); diff --git a/src/client/impl/ydb_internal/make_request/make.cpp b/src/client/impl/ydb_internal/make_request/make.cpp index bfbf465529..e16b9ae8d4 100644 --- a/src/client/impl/ydb_internal/make_request/make.cpp +++ b/src/client/impl/ydb_internal/make_request/make.cpp @@ -2,7 +2,7 @@ #include "make.h" -namespace NYdb { +namespace NYdb::inline V3 { void SetDuration(const TDuration& duration, google::protobuf::Duration& protoValue) { protoValue.set_seconds(duration.Seconds()); diff --git a/src/client/impl/ydb_internal/make_request/make.h b/src/client/impl/ydb_internal/make_request/make.h index ab11ef77d0..9f7a29a30a 100644 --- a/src/client/impl/ydb_internal/make_request/make.h +++ b/src/client/impl/ydb_internal/make_request/make.h @@ -7,7 +7,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { void SetDuration(const TDuration& duration, google::protobuf::Duration& protoValue); diff --git a/src/client/impl/ydb_internal/plain_status/status.cpp b/src/client/impl/ydb_internal/plain_status/status.cpp index 757321b27c..bb29e6583e 100644 --- a/src/client/impl/ydb_internal/plain_status/status.cpp +++ b/src/client/impl/ydb_internal/plain_status/status.cpp @@ -3,7 +3,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { using std::string; diff --git a/src/client/impl/ydb_internal/plain_status/status.h b/src/client/impl/ydb_internal/plain_status/status.h index d0109d38e6..b8a2ca71e1 100644 --- a/src/client/impl/ydb_internal/plain_status/status.h +++ b/src/client/impl/ydb_internal/plain_status/status.h @@ -11,7 +11,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { struct TPlainStatus { EStatus Status; diff --git a/src/client/impl/ydb_internal/retry/retry.cpp b/src/client/impl/ydb_internal/retry/retry.cpp index 7f4315e1c1..dbeb516677 100644 --- a/src/client/impl/ydb_internal/retry/retry.cpp +++ b/src/client/impl/ydb_internal/retry/retry.cpp @@ -9,7 +9,7 @@ #include -namespace NYdb::NRetry { +namespace NYdb::inline V3::NRetry { constexpr ui32 MAX_BACKOFF_DURATION_MS = TDuration::Hours(1).MilliSeconds(); diff --git a/src/client/impl/ydb_internal/retry/retry.h b/src/client/impl/ydb_internal/retry/retry.h index 738f7efc4e..d8f5f8bb79 100644 --- a/src/client/impl/ydb_internal/retry/retry.h +++ b/src/client/impl/ydb_internal/retry/retry.h @@ -13,11 +13,11 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { class IClientImplCommon; } -namespace NYdb::NRetry { +namespace NYdb::inline V3::NRetry { ui32 CalcBackoffTime(const TBackoffSettings& settings, ui32 retryNumber); void Backoff(const NRetry::TBackoffSettings& settings, ui32 retryNumber); diff --git a/src/client/impl/ydb_internal/retry/retry_async.h b/src/client/impl/ydb_internal/retry/retry_async.h index 393b9d9d0a..f19a0bf337 100644 --- a/src/client/impl/ydb_internal/retry/retry_async.h +++ b/src/client/impl/ydb_internal/retry/retry_async.h @@ -4,7 +4,7 @@ #include -namespace NYdb::NRetry::Async { +namespace NYdb::inline V3::NRetry::Async { template class TRetryContext : public TThrRefBase, public TRetryContextBase { diff --git a/src/client/impl/ydb_internal/retry/retry_sync.h b/src/client/impl/ydb_internal/retry/retry_sync.h index d9ac41295e..b0c63187bd 100644 --- a/src/client/impl/ydb_internal/retry/retry_sync.h +++ b/src/client/impl/ydb_internal/retry/retry_sync.h @@ -4,7 +4,7 @@ #include #include -namespace NYdb::NRetry::Sync { +namespace NYdb::inline V3::NRetry::Sync { template class TRetryContext : public TRetryContextBase { diff --git a/src/client/impl/ydb_internal/rpc_request_settings/settings.h b/src/client/impl/ydb_internal/rpc_request_settings/settings.h index 34a31f115e..515d20f642 100644 --- a/src/client/impl/ydb_internal/rpc_request_settings/settings.h +++ b/src/client/impl/ydb_internal/rpc_request_settings/settings.h @@ -3,7 +3,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { struct TRpcRequestSettings { std::string TraceId; diff --git a/src/client/impl/ydb_internal/scheme_helpers/helpers.h b/src/client/impl/ydb_internal/scheme_helpers/helpers.h index 9a6998b1cc..5a4c8528b1 100644 --- a/src/client/impl/ydb_internal/scheme_helpers/helpers.h +++ b/src/client/impl/ydb_internal/scheme_helpers/helpers.h @@ -3,7 +3,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { template inline void PermissionToSchemeEntry(const TFrom& from, std::vector* to) { diff --git a/src/client/impl/ydb_internal/session_client/session_client.h b/src/client/impl/ydb_internal/session_client/session_client.h index 49f26b28d0..db920a7ab9 100644 --- a/src/client/impl/ydb_internal/session_client/session_client.h +++ b/src/client/impl/ydb_internal/session_client/session_client.h @@ -4,7 +4,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { class TKqpSessionCommon; diff --git a/src/client/impl/ydb_internal/session_pool/session_pool.cpp b/src/client/impl/ydb_internal/session_pool/session_pool.cpp index 77025f8a3c..9484becb53 100644 --- a/src/client/impl/ydb_internal/session_pool/session_pool.cpp +++ b/src/client/impl/ydb_internal/session_pool/session_pool.cpp @@ -9,7 +9,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NSessionPool { using namespace NThreading; diff --git a/src/client/impl/ydb_internal/session_pool/session_pool.h b/src/client/impl/ydb_internal/session_pool/session_pool.h index 18a526ba1e..4a317b9704 100644 --- a/src/client/impl/ydb_internal/session_pool/session_pool.h +++ b/src/client/impl/ydb_internal/session_pool/session_pool.h @@ -4,7 +4,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { class TOperation; namespace NSessionPool { diff --git a/src/client/impl/ydb_internal/stats_extractor/extractor.h b/src/client/impl/ydb_internal/stats_extractor/extractor.h index a729dde937..964f30fea0 100644 --- a/src/client/impl/ydb_internal/stats_extractor/extractor.h +++ b/src/client/impl/ydb_internal/stats_extractor/extractor.h @@ -8,7 +8,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { class TStatsExtractor: public NSdkStats::IStatApi { public: diff --git a/src/client/impl/ydb_internal/table_helpers/helpers.h b/src/client/impl/ydb_internal/table_helpers/helpers.h index 2749a59dd3..80e1ce47ae 100644 --- a/src/client/impl/ydb_internal/table_helpers/helpers.h +++ b/src/client/impl/ydb_internal/table_helpers/helpers.h @@ -5,7 +5,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { inline Ydb::Table::QueryStatsCollection::Mode GetStatsCollectionMode(std::optional mode) { if (mode.has_value()) { diff --git a/src/client/impl/ydb_internal/thread_pool/pool.h b/src/client/impl/ydb_internal/thread_pool/pool.h index 3c1c07ba64..f29a7bb623 100644 --- a/src/client/impl/ydb_internal/thread_pool/pool.h +++ b/src/client/impl/ydb_internal/thread_pool/pool.h @@ -6,7 +6,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { inline std::unique_ptr CreateThreadPool(size_t threads) { std::unique_ptr queue; diff --git a/src/client/impl/ydb_internal/value_helpers/helpers.cpp b/src/client/impl/ydb_internal/value_helpers/helpers.cpp index dc8eaef59b..ebfbe83c83 100644 --- a/src/client/impl/ydb_internal/value_helpers/helpers.cpp +++ b/src/client/impl/ydb_internal/value_helpers/helpers.cpp @@ -4,7 +4,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { bool TypesEqual(const Ydb::Type& t1, const Ydb::Type& t2) { if (t1.type_case() != t2.type_case()) { diff --git a/src/client/impl/ydb_internal/value_helpers/helpers.h b/src/client/impl/ydb_internal/value_helpers/helpers.h index 54cc366e1b..8bb70e0ea9 100644 --- a/src/client/impl/ydb_internal/value_helpers/helpers.h +++ b/src/client/impl/ydb_internal/value_helpers/helpers.h @@ -4,7 +4,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { bool TypesEqual(const Ydb::Type& t1, const Ydb::Type& t2); diff --git a/src/client/impl/ydb_stats/stats.cpp b/src/client/impl/ydb_stats/stats.cpp index 916ce1239f..4139ba9dd9 100644 --- a/src/client/impl/ydb_stats/stats.cpp +++ b/src/client/impl/ydb_stats/stats.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NSdkStats { using std::string; diff --git a/src/client/impl/ydb_stats/stats.h b/src/client/impl/ydb_stats/stats.h index a4c7a610cf..9226872c9a 100644 --- a/src/client/impl/ydb_stats/stats.h +++ b/src/client/impl/ydb_stats/stats.h @@ -9,8 +9,7 @@ #include #include -namespace NYdb { - +namespace NYdb::inline V3 { namespace NSdkStats { // works only for case normal (foo_bar) underscore @@ -401,5 +400,4 @@ struct TStatCollector { }; } // namespace NSdkStats - -} // namespace Nydb +} // namespace NYdb diff --git a/src/client/import/import.cpp b/src/client/import/import.cpp index 6eaa52b16d..fe8062a3c7 100644 --- a/src/client/import/import.cpp +++ b/src/client/import/import.cpp @@ -10,7 +10,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NImport { using namespace NThreading; diff --git a/src/client/monitoring/monitoring.cpp b/src/client/monitoring/monitoring.cpp index 8650dd22ce..6b7b4f1bcf 100644 --- a/src/client/monitoring/monitoring.cpp +++ b/src/client/monitoring/monitoring.cpp @@ -9,7 +9,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NMonitoring { using namespace NThreading; diff --git a/src/client/operation/operation.cpp b/src/client/operation/operation.cpp index 0c815473fe..059fa9d2d8 100644 --- a/src/client/operation/operation.cpp +++ b/src/client/operation/operation.cpp @@ -15,7 +15,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NOperation { constexpr TDuration OPERATION_CLIENT_TIMEOUT = TDuration::Seconds(5); diff --git a/src/client/params/impl.cpp b/src/client/params/impl.cpp index 63c91ef60b..62f231eefc 100644 --- a/src/client/params/impl.cpp +++ b/src/client/params/impl.cpp @@ -4,7 +4,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { TParams::TImpl::TImpl(::google::protobuf::Map&& paramsMap) { ParamsMap_.swap(paramsMap); diff --git a/src/client/params/impl.h b/src/client/params/impl.h index 6e4506c4e4..8594f955f7 100644 --- a/src/client/params/impl.h +++ b/src/client/params/impl.h @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { class TParams::TImpl { public: diff --git a/src/client/params/params.cpp b/src/client/params/params.cpp index c15b144bca..5d448a2d75 100644 --- a/src/client/params/params.cpp +++ b/src/client/params/params.cpp @@ -8,7 +8,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { //////////////////////////////////////////////////////////////////////////////// diff --git a/src/client/persqueue_public/impl/aliases.h b/src/client/persqueue_public/impl/aliases.h index 2796da017a..96de4ce1c8 100644 --- a/src/client/persqueue_public/impl/aliases.h +++ b/src/client/persqueue_public/impl/aliases.h @@ -5,7 +5,7 @@ #include #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { // codecs using NTopic::ICodec; diff --git a/src/client/persqueue_public/impl/common.cpp b/src/client/persqueue_public/impl/common.cpp index aa806f415f..18df160d2e 100644 --- a/src/client/persqueue_public/impl/common.cpp +++ b/src/client/persqueue_public/impl/common.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { ERetryErrorClass GetRetryErrorClass(EStatus status) { switch (status) { diff --git a/src/client/persqueue_public/impl/common.h b/src/client/persqueue_public/impl/common.h index 945b411e73..b99341fbbb 100644 --- a/src/client/persqueue_public/impl/common.h +++ b/src/client/persqueue_public/impl/common.h @@ -4,7 +4,7 @@ #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { ERetryErrorClass GetRetryErrorClass(EStatus status); ERetryErrorClass GetRetryErrorClassV2(EStatus status); } diff --git a/src/client/persqueue_public/impl/persqueue.cpp b/src/client/persqueue_public/impl/persqueue.cpp index 82f5c7332f..4fad6d95f6 100644 --- a/src/client/persqueue_public/impl/persqueue.cpp +++ b/src/client/persqueue_public/impl/persqueue.cpp @@ -8,7 +8,7 @@ #include #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { class TCommonCodecsProvider { public: diff --git a/src/client/persqueue_public/impl/persqueue_impl.cpp b/src/client/persqueue_public/impl/persqueue_impl.cpp index 29435231b1..0ce4ff9efa 100644 --- a/src/client/persqueue_public/impl/persqueue_impl.cpp +++ b/src/client/persqueue_public/impl/persqueue_impl.cpp @@ -3,7 +3,7 @@ #include "read_session.h" #include "write_session.h" -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { std::shared_ptr TPersQueueClient::TImpl::CreateReadSession(const TReadSessionSettings& settings) { std::optional maybeSettings; diff --git a/src/client/persqueue_public/impl/persqueue_impl.h b/src/client/persqueue_public/impl/persqueue_impl.h index 0f90c4f961..31d38e2956 100644 --- a/src/client/persqueue_public/impl/persqueue_impl.h +++ b/src/client/persqueue_public/impl/persqueue_impl.h @@ -12,7 +12,7 @@ #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { class TPersQueueClient::TImpl : public TClientImplCommon { public: diff --git a/src/client/persqueue_public/impl/read_session.cpp b/src/client/persqueue_public/impl/read_session.cpp index 45bda6e817..3e0e9dda3a 100644 --- a/src/client/persqueue_public/impl/read_session.cpp +++ b/src/client/persqueue_public/impl/read_session.cpp @@ -10,7 +10,7 @@ #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { static const std::string DRIVER_IS_STOPPING_DESCRIPTION = "Driver is stopping"; diff --git a/src/client/persqueue_public/impl/read_session.h b/src/client/persqueue_public/impl/read_session.h index 1903995f76..df67c60d21 100644 --- a/src/client/persqueue_public/impl/read_session.h +++ b/src/client/persqueue_public/impl/read_session.h @@ -8,7 +8,7 @@ #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { // High level class that manages several read session impls. // Each one of them works with single cluster. diff --git a/src/client/persqueue_public/impl/read_session_messages.cpp b/src/client/persqueue_public/impl/read_session_messages.cpp index 2eb44e9633..4d7a82631d 100644 --- a/src/client/persqueue_public/impl/read_session_messages.cpp +++ b/src/client/persqueue_public/impl/read_session_messages.cpp @@ -4,7 +4,7 @@ #include #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { TReadSessionEvent::TDataReceivedEvent::TMessageInformation::TMessageInformation( ui64 offset, diff --git a/src/client/persqueue_public/impl/write_session.cpp b/src/client/persqueue_public/impl/write_session.cpp index 52df1286f4..efafbfa2d5 100644 --- a/src/client/persqueue_public/impl/write_session.cpp +++ b/src/client/persqueue_public/impl/write_session.cpp @@ -8,7 +8,7 @@ #include #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // TWriteSession diff --git a/src/client/persqueue_public/impl/write_session.h b/src/client/persqueue_public/impl/write_session.h index 41873ceb7d..7fa9f4c2c6 100644 --- a/src/client/persqueue_public/impl/write_session.h +++ b/src/client/persqueue_public/impl/write_session.h @@ -8,7 +8,7 @@ #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { namespace NTests { class TSimpleWriteSessionTestAdapter; diff --git a/src/client/persqueue_public/impl/write_session_impl.cpp b/src/client/persqueue_public/impl/write_session_impl.cpp index 4b9dd0eec0..022bea0714 100644 --- a/src/client/persqueue_public/impl/write_session_impl.cpp +++ b/src/client/persqueue_public/impl/write_session_impl.cpp @@ -11,7 +11,7 @@ #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { const TDuration UPDATE_TOKEN_PERIOD = TDuration::Hours(1); diff --git a/src/client/persqueue_public/impl/write_session_impl.h b/src/client/persqueue_public/impl/write_session_impl.h index 82a8bbdb7a..483570c944 100644 --- a/src/client/persqueue_public/impl/write_session_impl.h +++ b/src/client/persqueue_public/impl/write_session_impl.h @@ -7,7 +7,7 @@ #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // TWriteSessionEventsQueue diff --git a/src/client/persqueue_public/include/aliases.h b/src/client/persqueue_public/include/aliases.h index 24f0ffa5a9..0cd8c0c835 100644 --- a/src/client/persqueue_public/include/aliases.h +++ b/src/client/persqueue_public/include/aliases.h @@ -7,7 +7,7 @@ #include #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { // codecs using NTopic::ECodec; diff --git a/src/client/persqueue_public/include/client.h b/src/client/persqueue_public/include/client.h index 1797fda685..71bfd09507 100644 --- a/src/client/persqueue_public/include/client.h +++ b/src/client/persqueue_public/include/client.h @@ -7,11 +7,11 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { class TProtoAccessor; } -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { struct TPersQueueClientSettings : public TCommonClientSettingsBase { using TSelf = TPersQueueClientSettings; diff --git a/src/client/persqueue_public/include/control_plane.h b/src/client/persqueue_public/include/control_plane.h index 0511fb8e50..025364aecc 100644 --- a/src/client/persqueue_public/include/control_plane.h +++ b/src/client/persqueue_public/include/control_plane.h @@ -10,11 +10,11 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { class TProtoAccessor; } -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { enum class EFormat { BASE = 1, @@ -45,7 +45,7 @@ struct TCredentials { // Result for describe resource request. struct TDescribeTopicResult : public TStatus { - friend class NYdb::TProtoAccessor; + friend class NYdb::V3::TProtoAccessor; struct TTopicSettings { TTopicSettings(const Ydb::PersQueue::V1::TopicSettings&); diff --git a/src/client/persqueue_public/include/read_events.h b/src/client/persqueue_public/include/read_events.h index 494bad2fd6..7152be3251 100644 --- a/src/client/persqueue_public/include/read_events.h +++ b/src/client/persqueue_public/include/read_events.h @@ -4,7 +4,7 @@ #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { //! Partition stream. struct TPartitionStream : public TThrRefBase { diff --git a/src/client/persqueue_public/include/read_session.h b/src/client/persqueue_public/include/read_session.h index 1c33c8d9d5..9d80184840 100644 --- a/src/client/persqueue_public/include/read_session.h +++ b/src/client/persqueue_public/include/read_session.h @@ -11,7 +11,7 @@ #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { //! Read settings for single topic. struct TTopicReadSettings { diff --git a/src/client/persqueue_public/include/write_events.h b/src/client/persqueue_public/include/write_events.h index 3bcd61f058..2f5cee513e 100644 --- a/src/client/persqueue_public/include/write_events.h +++ b/src/client/persqueue_public/include/write_events.h @@ -6,7 +6,7 @@ #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { struct TWriteStat : public TThrRefBase { TDuration WriteTime; diff --git a/src/client/persqueue_public/include/write_session.h b/src/client/persqueue_public/include/write_session.h index c2cbc776d7..98852c4648 100644 --- a/src/client/persqueue_public/include/write_session.h +++ b/src/client/persqueue_public/include/write_session.h @@ -8,7 +8,7 @@ #include -namespace NYdb::NPersQueue { +namespace NYdb::inline V3::NPersQueue { enum class EClusterDiscoveryMode { Auto = 0, // enables cluster discovery only for hostname "logbroker.yandex.net" and "logbroker-prestable.yandex.net" diff --git a/src/client/proto/accessor.cpp b/src/client/proto/accessor.cpp index 7ec24b4715..9adbba5c0e 100644 --- a/src/client/proto/accessor.cpp +++ b/src/client/proto/accessor.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { const Ydb::Type& TProtoAccessor::GetProto(const TType& type) { return type.GetProto(); diff --git a/src/client/query/client.cpp b/src/client/query/client.cpp index bf9ccb90fe..44ee0cdcb5 100644 --- a/src/client/query/client.cpp +++ b/src/client/query/client.cpp @@ -19,7 +19,7 @@ #include -namespace NYdb::NQuery { +namespace NYdb::inline V3::NQuery { using TRetryContextResultAsync = NRetry::Async::TRetryContext; using TRetryContextAsync = NRetry::Async::TRetryContext; diff --git a/src/client/query/impl/client_session.cpp b/src/client/query/impl/client_session.cpp index 40b5ab7c97..eb8281f1dc 100644 --- a/src/client/query/impl/client_session.cpp +++ b/src/client/query/impl/client_session.cpp @@ -6,7 +6,7 @@ #include -namespace NYdb::NQuery { +namespace NYdb::inline V3::NQuery { TSession::TImpl::TImpl(TStreamProcessorPtr ptr, const std::string& sessionId, const std::string& endpoint) : TKqpSessionCommon(sessionId, endpoint, true) diff --git a/src/client/query/impl/client_session.h b/src/client/query/impl/client_session.h index 4400c30d3b..2a9b8ac52c 100644 --- a/src/client/query/impl/client_session.h +++ b/src/client/query/impl/client_session.h @@ -5,7 +5,7 @@ #include -namespace NYdb::NQuery { +namespace NYdb::inline V3::NQuery { class TSession::TImpl : public TKqpSessionCommon { public: diff --git a/src/client/query/impl/exec_query.cpp b/src/client/query/impl/exec_query.cpp index 6e8541a927..a26daebabc 100644 --- a/src/client/query/impl/exec_query.cpp +++ b/src/client/query/impl/exec_query.cpp @@ -13,7 +13,7 @@ #include -namespace NYdb::NQuery { +namespace NYdb::inline V3::NQuery { using namespace NThreading; diff --git a/src/client/query/impl/exec_query.h b/src/client/query/impl/exec_query.h index 33caee5b0b..b20246e84b 100644 --- a/src/client/query/impl/exec_query.h +++ b/src/client/query/impl/exec_query.h @@ -7,7 +7,7 @@ #include #include -namespace NYdb::NQuery { +namespace NYdb::inline V3::NQuery { class TExecQueryImpl { public: diff --git a/src/client/query/query.cpp b/src/client/query/query.cpp index 971d33014c..5934edef92 100644 --- a/src/client/query/query.cpp +++ b/src/client/query/query.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb::NQuery { +namespace NYdb::inline V3::NQuery { std::optional ParseStatsMode(std::string_view statsMode) { if (statsMode == "unspecified") { diff --git a/src/client/query/stats.cpp b/src/client/query/stats.cpp index 5764c39e3a..02da828dfa 100644 --- a/src/client/query/stats.cpp +++ b/src/client/query/stats.cpp @@ -8,7 +8,7 @@ #include -namespace NYdb::NQuery { +namespace NYdb::inline V3::NQuery { class TExecStats::TImpl { public: diff --git a/src/client/rate_limiter/rate_limiter.cpp b/src/client/rate_limiter/rate_limiter.cpp index d790a4cf56..05f8cca249 100644 --- a/src/client/rate_limiter/rate_limiter.cpp +++ b/src/client/rate_limiter/rate_limiter.cpp @@ -7,7 +7,7 @@ #include #include -namespace NYdb::NRateLimiter { +namespace NYdb::inline V3::NRateLimiter { TListResourcesResult::TListResourcesResult(TStatus status, std::vector paths) : TStatus(std::move(status)) diff --git a/src/client/resources/ydb_ca.cpp b/src/client/resources/ydb_ca.cpp index 21a538623d..6c33ac213f 100644 --- a/src/client/resources/ydb_ca.cpp +++ b/src/client/resources/ydb_ca.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { std::string GetRootCertificate() { return NResource::Find("ydb_root_ca.pem"); diff --git a/src/client/resources/ydb_resources.cpp b/src/client/resources/ydb_resources.cpp index 580d308044..daf614fb33 100644 --- a/src/client/resources/ydb_resources.cpp +++ b/src/client/resources/ydb_resources.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { const char* YDB_AUTH_TICKET_HEADER = "x-ydb-auth-ticket"; const char* YDB_DATABASE_HEADER = "x-ydb-database"; diff --git a/src/client/resources/ydb_sdk_version.txt b/src/client/resources/ydb_sdk_version.txt index d5724cd41b..56fea8a08d 100644 --- a/src/client/resources/ydb_sdk_version.txt +++ b/src/client/resources/ydb_sdk_version.txt @@ -1 +1 @@ -2.6.2 \ No newline at end of file +3.0.0 \ No newline at end of file diff --git a/src/client/result/proto_accessor.cpp b/src/client/result/proto_accessor.cpp index 9e20cb2af3..3e5e35018e 100644 --- a/src/client/result/proto_accessor.cpp +++ b/src/client/result/proto_accessor.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { const Ydb::ResultSet& TProtoAccessor::GetProto(const TResultSet& resultSet) { return resultSet.GetProto(); diff --git a/src/client/result/result.cpp b/src/client/result/result.cpp index 4f52c54932..97fd03c70d 100644 --- a/src/client/result/result.cpp +++ b/src/client/result/result.cpp @@ -11,7 +11,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { std::string TColumn::ToString() const { TString result; diff --git a/src/client/scheme/scheme.cpp b/src/client/scheme/scheme.cpp index 08d9fb5e0e..0eb5d1d95e 100644 --- a/src/client/scheme/scheme.cpp +++ b/src/client/scheme/scheme.cpp @@ -11,7 +11,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NScheme { using namespace NThreading; diff --git a/src/client/ss_tasks/task.cpp b/src/client/ss_tasks/task.cpp index 39216d228e..cee6cc3e53 100644 --- a/src/client/ss_tasks/task.cpp +++ b/src/client/ss_tasks/task.cpp @@ -5,7 +5,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NSchemeShard { /// YT diff --git a/src/client/ss_tasks/task.h b/src/client/ss_tasks/task.h index 1f51f806cb..5c0c4db186 100644 --- a/src/client/ss_tasks/task.h +++ b/src/client/ss_tasks/task.h @@ -5,7 +5,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NSchemeShard { class TBackgroundProcessesResponse: public TOperation { diff --git a/src/client/table/impl/client_session.cpp b/src/client/table/impl/client_session.cpp index 4e5ccc42b9..cbab337644 100644 --- a/src/client/table/impl/client_session.cpp +++ b/src/client/table/impl/client_session.cpp @@ -3,7 +3,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NTable { TSession::TImpl::TImpl(const std::string& sessionId, const std::string& endpoint, bool useQueryCache, ui32 queryCacheSize, bool isOwnedBySessionPool) diff --git a/src/client/table/impl/client_session.h b/src/client/table/impl/client_session.h index 4e4a9aeb93..dab53f500f 100644 --- a/src/client/table/impl/client_session.h +++ b/src/client/table/impl/client_session.h @@ -13,7 +13,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NTable { //////////////////////////////////////////////////////////////////////////////// diff --git a/src/client/table/impl/data_query.cpp b/src/client/table/impl/data_query.cpp index 7d9f87247c..2afe7bd636 100644 --- a/src/client/table/impl/data_query.cpp +++ b/src/client/table/impl/data_query.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NTable { std::string GetQueryHash(const std::string& text) { diff --git a/src/client/table/impl/data_query.h b/src/client/table/impl/data_query.h index 2c2ec5b923..a04fcebc27 100644 --- a/src/client/table/impl/data_query.h +++ b/src/client/table/impl/data_query.h @@ -7,7 +7,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NTable { std::string EncodeQuery(const std::string& text, bool reversible); diff --git a/src/client/table/impl/readers.cpp b/src/client/table/impl/readers.cpp index 505e1f2cb0..acb5f6dd58 100644 --- a/src/client/table/impl/readers.cpp +++ b/src/client/table/impl/readers.cpp @@ -3,7 +3,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NTable { using namespace NThreading; diff --git a/src/client/table/impl/readers.h b/src/client/table/impl/readers.h index cba8c674b1..440c9b8de0 100644 --- a/src/client/table/impl/readers.h +++ b/src/client/table/impl/readers.h @@ -12,7 +12,7 @@ #include "request_migrator.h" -namespace NYdb { +namespace NYdb::inline V3 { namespace NTable { using namespace NThreading; diff --git a/src/client/table/impl/request_migrator.cpp b/src/client/table/impl/request_migrator.cpp index 21fe00039b..94d4973581 100644 --- a/src/client/table/impl/request_migrator.cpp +++ b/src/client/table/impl/request_migrator.cpp @@ -4,7 +4,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NMath { diff --git a/src/client/table/impl/request_migrator.h b/src/client/table/impl/request_migrator.h index 8b0dbb9f18..e33967d42b 100644 --- a/src/client/table/impl/request_migrator.h +++ b/src/client/table/impl/request_migrator.h @@ -11,7 +11,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NMath { diff --git a/src/client/table/impl/table_client.cpp b/src/client/table/impl/table_client.cpp index 06940d5a61..335c46d555 100644 --- a/src/client/table/impl/table_client.cpp +++ b/src/client/table/impl/table_client.cpp @@ -1,6 +1,6 @@ #include "table_client.h" -namespace NYdb { +namespace NYdb::inline V3 { namespace NTable { diff --git a/src/client/table/impl/table_client.h b/src/client/table/impl/table_client.h index dbb94fa209..03c78f282b 100644 --- a/src/client/table/impl/table_client.h +++ b/src/client/table/impl/table_client.h @@ -19,7 +19,7 @@ #include "readers.h" -namespace NYdb { +namespace NYdb::inline V3 { namespace NTable { //How ofter run host scan to perform session balancing diff --git a/src/client/table/impl/transaction.cpp b/src/client/table/impl/transaction.cpp index 8234ae26b1..6627804a18 100644 --- a/src/client/table/impl/transaction.cpp +++ b/src/client/table/impl/transaction.cpp @@ -1,7 +1,7 @@ #include "transaction.h" #include "table_client.h" -namespace NYdb::NTable { +namespace NYdb::inline V3::NTable { TTransaction::TImpl::TImpl(const TSession& session, const std::string& txId) : Session_(session) diff --git a/src/client/table/impl/transaction.h b/src/client/table/impl/transaction.h index 6cf4675641..c226d8ca35 100644 --- a/src/client/table/impl/transaction.h +++ b/src/client/table/impl/transaction.h @@ -2,7 +2,7 @@ #include -namespace NYdb::NTable { +namespace NYdb::inline V3::NTable { class TTransaction::TImpl { public: diff --git a/src/client/table/proto_accessor.cpp b/src/client/table/proto_accessor.cpp index 47f323a0f8..98224b2578 100644 --- a/src/client/table/proto_accessor.cpp +++ b/src/client/table/proto_accessor.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { const Ydb::TableStats::QueryStats& TProtoAccessor::GetProto(const NTable::TQueryStats& queryStats) { return queryStats.GetProto(); diff --git a/src/client/table/query_stats/stats.cpp b/src/client/table/query_stats/stats.cpp index 53783155b1..cf683df982 100644 --- a/src/client/table/query_stats/stats.cpp +++ b/src/client/table/query_stats/stats.cpp @@ -1,6 +1,6 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NTable { std::optional ParseQueryStatsMode(std::string_view statsMode) diff --git a/src/client/table/table.cpp b/src/client/table/table.cpp index 0e1f3dc3e3..7ca0df537a 100644 --- a/src/client/table/table.cpp +++ b/src/client/table/table.cpp @@ -33,7 +33,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace NTable { using namespace NThreading; diff --git a/src/client/topic/codecs/codecs.cpp b/src/client/topic/codecs/codecs.cpp index 8e4fd02398..14c5eddead 100644 --- a/src/client/topic/codecs/codecs.cpp +++ b/src/client/topic/codecs/codecs.cpp @@ -5,7 +5,7 @@ #include #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { namespace { diff --git a/src/client/topic/common/callback_context.h b/src/client/topic/common/callback_context.h index 3a86fb55b8..a6789ee27f 100644 --- a/src/client/topic/common/callback_context.h +++ b/src/client/topic/common/callback_context.h @@ -10,7 +10,7 @@ #include #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { template class TContextOwner; diff --git a/src/client/topic/common/executor_impl.cpp b/src/client/topic/common/executor_impl.cpp index 676aa1d9dc..39c56acb32 100644 --- a/src/client/topic/common/executor_impl.cpp +++ b/src/client/topic/common/executor_impl.cpp @@ -1,6 +1,6 @@ #include "executor_impl.h" -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { void IAsyncExecutor::Post(TFunction&& f) { PostImpl(std::move(f)); diff --git a/src/client/topic/common/executor_impl.h b/src/client/topic/common/executor_impl.h index f223b97a83..cd06370e66 100644 --- a/src/client/topic/common/executor_impl.h +++ b/src/client/topic/common/executor_impl.h @@ -7,7 +7,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { class IAsyncExecutor : public IExecutor { private: diff --git a/src/client/topic/common/retry_policy.cpp b/src/client/topic/common/retry_policy.cpp index 8817616f86..a2bac4767a 100644 --- a/src/client/topic/common/retry_policy.cpp +++ b/src/client/topic/common/retry_policy.cpp @@ -1,7 +1,7 @@ #include #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { IRetryPolicy::TPtr IRetryPolicy::GetDefaultPolicy() { static IRetryPolicy::TPtr policy = GetExponentialBackoffPolicy(); diff --git a/src/client/topic/impl/common.cpp b/src/client/topic/impl/common.cpp index 160682edfa..5b3be0554b 100644 --- a/src/client/topic/impl/common.cpp +++ b/src/client/topic/impl/common.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { ERetryErrorClass GetRetryErrorClass(EStatus status) { switch (status) { diff --git a/src/client/topic/impl/common.h b/src/client/topic/impl/common.h index cca058c759..0445589cbd 100644 --- a/src/client/topic/impl/common.h +++ b/src/client/topic/impl/common.h @@ -10,7 +10,7 @@ #include #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { ERetryErrorClass GetRetryErrorClass(EStatus status); ERetryErrorClass GetRetryErrorClassV2(EStatus status); diff --git a/src/client/topic/impl/counters_logger.h b/src/client/topic/impl/counters_logger.h index b68bd64b71..9edc26a6b2 100644 --- a/src/client/topic/impl/counters_logger.h +++ b/src/client/topic/impl/counters_logger.h @@ -8,7 +8,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { template class TSingleClusterReadSessionImpl; diff --git a/src/client/topic/impl/deferred_commit.cpp b/src/client/topic/impl/deferred_commit.cpp index 128e56cf08..53e10bfd15 100644 --- a/src/client/topic/impl/deferred_commit.cpp +++ b/src/client/topic/impl/deferred_commit.cpp @@ -4,7 +4,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { std::pair GetMessageOffsetRange(const TReadSessionEvent::TDataReceivedEvent& dataReceivedEvent, uint64_t index); diff --git a/src/client/topic/impl/event_handlers.cpp b/src/client/topic/impl/event_handlers.cpp index 259a7ed707..1a4fad20fa 100644 --- a/src/client/topic/impl/event_handlers.cpp +++ b/src/client/topic/impl/event_handlers.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { std::pair GetMessageOffsetRange(const TReadSessionEvent::TDataReceivedEvent& dataReceivedEvent, uint64_t index); diff --git a/src/client/topic/impl/offsets_collector.cpp b/src/client/topic/impl/offsets_collector.cpp index ea3ead2776..b846ccf703 100644 --- a/src/client/topic/impl/offsets_collector.cpp +++ b/src/client/topic/impl/offsets_collector.cpp @@ -1,6 +1,6 @@ #include "offsets_collector.h" -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { std::vector TOffsetsCollector::GetOffsets() const { diff --git a/src/client/topic/impl/offsets_collector.h b/src/client/topic/impl/offsets_collector.h index 281d01c1f6..3e18087051 100644 --- a/src/client/topic/impl/offsets_collector.h +++ b/src/client/topic/impl/offsets_collector.h @@ -14,7 +14,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { class TOffsetsCollector { public: diff --git a/src/client/topic/impl/read_session.cpp b/src/client/topic/impl/read_session.cpp index 0c80f72ca6..e73ce3f403 100644 --- a/src/client/topic/impl/read_session.cpp +++ b/src/client/topic/impl/read_session.cpp @@ -7,7 +7,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { static const std::string DRIVER_IS_STOPPING_DESCRIPTION = "Driver is stopping"; diff --git a/src/client/topic/impl/read_session.h b/src/client/topic/impl/read_session.h index 54d044127f..21cf15479c 100644 --- a/src/client/topic/impl/read_session.h +++ b/src/client/topic/impl/read_session.h @@ -6,7 +6,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { class TReadSession : public IReadSession { public: diff --git a/src/client/topic/impl/read_session_event.cpp b/src/client/topic/impl/read_session_event.cpp index 4895167d41..8eb8858e84 100644 --- a/src/client/topic/impl/read_session_event.cpp +++ b/src/client/topic/impl/read_session_event.cpp @@ -3,7 +3,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Aliases for event types diff --git a/src/client/topic/impl/read_session_impl.h b/src/client/topic/impl/read_session_impl.h index 40e1b4535f..acc7f8a4ce 100644 --- a/src/client/topic/impl/read_session_impl.h +++ b/src/client/topic/impl/read_session_impl.h @@ -30,7 +30,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { template using TClientMessage = std::conditional_t -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { static const bool RangesMode = !std::string{std::getenv("PQ_OFFSET_RANGES_MODE") ? std::getenv("PQ_OFFSET_RANGES_MODE") : ""}.empty(); diff --git a/src/client/topic/impl/topic.cpp b/src/client/topic/impl/topic.cpp index 677a75b96b..d11d8d33bd 100644 --- a/src/client/topic/impl/topic.cpp +++ b/src/client/topic/impl/topic.cpp @@ -9,7 +9,7 @@ #include #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { class TCommonCodecsProvider { public: diff --git a/src/client/topic/impl/topic_impl.cpp b/src/client/topic/impl/topic_impl.cpp index 8e65f646bb..b0ace7334f 100644 --- a/src/client/topic/impl/topic_impl.cpp +++ b/src/client/topic/impl/topic_impl.cpp @@ -3,7 +3,7 @@ #include "read_session.h" #include "write_session.h" -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { std::shared_ptr TTopicClient::TImpl::CreateReadSession(const TReadSessionSettings& settings) { std::optional maybeSettings; diff --git a/src/client/topic/impl/topic_impl.h b/src/client/topic/impl/topic_impl.h index b820a46fa7..494bd07294 100644 --- a/src/client/topic/impl/topic_impl.h +++ b/src/client/topic/impl/topic_impl.h @@ -13,7 +13,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { struct TOffsetsRange { ui64 Start; ui64 End; diff --git a/src/client/topic/impl/transaction.cpp b/src/client/topic/impl/transaction.cpp index d912bc54fd..662a4e6121 100644 --- a/src/client/topic/impl/transaction.cpp +++ b/src/client/topic/impl/transaction.cpp @@ -1,7 +1,7 @@ #include "transaction.h" #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { TTransactionId MakeTransactionId(const NTable::TTransaction& tx) { diff --git a/src/client/topic/impl/transaction.h b/src/client/topic/impl/transaction.h index 27d9672c49..721ecf6193 100644 --- a/src/client/topic/impl/transaction.h +++ b/src/client/topic/impl/transaction.h @@ -2,13 +2,13 @@ #include -namespace NYdb::NTable { +namespace NYdb::inline V3::NTable { class TTransaction; } -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { using TTransactionId = std::pair; diff --git a/src/client/topic/impl/write_session.cpp b/src/client/topic/impl/write_session.cpp index c8edb06021..b19d03eae4 100644 --- a/src/client/topic/impl/write_session.cpp +++ b/src/client/topic/impl/write_session.cpp @@ -2,7 +2,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // TWriteSession diff --git a/src/client/topic/impl/write_session.h b/src/client/topic/impl/write_session.h index 25e77477dd..77beb2898d 100644 --- a/src/client/topic/impl/write_session.h +++ b/src/client/topic/impl/write_session.h @@ -8,7 +8,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // TWriteSession diff --git a/src/client/topic/impl/write_session_impl.cpp b/src/client/topic/impl/write_session_impl.cpp index 016d3c5860..0401e17f43 100644 --- a/src/client/topic/impl/write_session_impl.cpp +++ b/src/client/topic/impl/write_session_impl.cpp @@ -12,7 +12,7 @@ #include #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { const TDuration UPDATE_TOKEN_PERIOD = TDuration::Hours(1); // Error code from file ydb/public/api/protos/persqueue_error_codes_v1.proto diff --git a/src/client/topic/impl/write_session_impl.h b/src/client/topic/impl/write_session_impl.h index 56d9692ba3..448134b60f 100644 --- a/src/client/topic/impl/write_session_impl.h +++ b/src/client/topic/impl/write_session_impl.h @@ -9,7 +9,7 @@ #include -namespace NYdb::NTopic { +namespace NYdb::inline V3::NTopic { class TWriteSessionEventsQueue: public TBaseSessionEventsQueue { using TParent = TBaseSessionEventsQueue; diff --git a/src/client/topic/proto_accessor.cpp b/src/client/topic/proto_accessor.cpp index c0147f19f7..4b333ca7bd 100644 --- a/src/client/topic/proto_accessor.cpp +++ b/src/client/topic/proto_accessor.cpp @@ -1,6 +1,6 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { const Ydb::Topic::DescribeTopicResult& TProtoAccessor::GetProto(const NTopic::TTopicDescription& topicDescription) { return topicDescription.GetProto(); } diff --git a/src/client/types/core_facility/core_facility.h b/src/client/types/core_facility/core_facility.h index 33556b5982..772512bdb6 100644 --- a/src/client/types/core_facility/core_facility.h +++ b/src/client/types/core_facility/core_facility.h @@ -3,7 +3,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { using TPeriodicCb = std::function; // !!!Experimental!!! diff --git a/src/client/types/credentials/credentials.cpp b/src/client/types/credentials/credentials.cpp index d75916cae8..2a3e0a83a9 100644 --- a/src/client/types/credentials/credentials.cpp +++ b/src/client/types/credentials/credentials.cpp @@ -1,7 +1,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { class TInsecureCredentialsProvider : public ICredentialsProvider { public: diff --git a/src/client/types/credentials/login/login.cpp b/src/client/types/credentials/login/login.cpp index f6b7b3534e..c6985d11e4 100644 --- a/src/client/types/credentials/login/login.cpp +++ b/src/client/types/credentials/login/login.cpp @@ -9,7 +9,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace { diff --git a/src/client/types/credentials/oauth2_token_exchange/credentials.cpp b/src/client/types/credentials/oauth2_token_exchange/credentials.cpp index a780fa8e68..081b52a0dc 100644 --- a/src/client/types/credentials/oauth2_token_exchange/credentials.cpp +++ b/src/client/types/credentials/oauth2_token_exchange/credentials.cpp @@ -20,7 +20,7 @@ #define INV_ARG "Invalid argument for " PROV_ERR #define EXCH_ERR "Exchange token error in " PROV_ERR -namespace NYdb { +namespace NYdb::inline V3 { namespace { diff --git a/src/client/types/credentials/oauth2_token_exchange/from_file.cpp b/src/client/types/credentials/oauth2_token_exchange/from_file.cpp index c4b23569c8..b8b4fc889c 100644 --- a/src/client/types/credentials/oauth2_token_exchange/from_file.cpp +++ b/src/client/types/credentials/oauth2_token_exchange/from_file.cpp @@ -13,7 +13,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { namespace { diff --git a/src/client/types/credentials/oauth2_token_exchange/jwt_token_source.cpp b/src/client/types/credentials/oauth2_token_exchange/jwt_token_source.cpp index 5001f9e028..09bca9a42d 100644 --- a/src/client/types/credentials/oauth2_token_exchange/jwt_token_source.cpp +++ b/src/client/types/credentials/oauth2_token_exchange/jwt_token_source.cpp @@ -6,7 +6,7 @@ #define INV_ARG "Invalid argument for JWT token source: " -namespace NYdb { +namespace NYdb::inline V3 { #ifdef YDB_SDK_USE_NEW_JWT using TJwtCppStorage = std::vector; diff --git a/src/client/types/exceptions/exceptions.cpp b/src/client/types/exceptions/exceptions.cpp index 47299560e2..f425e342cf 100644 --- a/src/client/types/exceptions/exceptions.cpp +++ b/src/client/types/exceptions/exceptions.cpp @@ -1,6 +1,6 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { TYdbException::TYdbException(const std::string& reason) { Append(reason); diff --git a/src/client/types/fatal_error_handlers/handlers.cpp b/src/client/types/fatal_error_handlers/handlers.cpp index 438453f2e6..66fdb71f0d 100644 --- a/src/client/types/fatal_error_handlers/handlers.cpp +++ b/src/client/types/fatal_error_handlers/handlers.cpp @@ -1,7 +1,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { void ThrowFatalError(const std::string& str) { throw TContractViolation(str); diff --git a/src/client/types/operation/operation.cpp b/src/client/types/operation/operation.cpp index c325f465e7..975cdb8891 100644 --- a/src/client/types/operation/operation.cpp +++ b/src/client/types/operation/operation.cpp @@ -7,7 +7,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { class TOperation::TImpl { diff --git a/src/client/types/status/status.cpp b/src/client/types/status/status.cpp index ee7db9149a..fb94a9b704 100644 --- a/src/client/types/status/status.cpp +++ b/src/client/types/status/status.cpp @@ -8,7 +8,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { class TStatus::TImpl { public: diff --git a/src/client/value/value.cpp b/src/client/value/value.cpp index 7c3665cb28..a6a9e7f951 100644 --- a/src/client/value/value.cpp +++ b/src/client/value/value.cpp @@ -19,7 +19,7 @@ #include #include -namespace NYdb { +namespace NYdb::inline V3 { static void CheckKind(TTypeParser::ETypeKind actual, TTypeParser::ETypeKind expected, const std::string& method) { diff --git a/tests/unit/client/draft/helpers/grpc_server.h b/tests/unit/client/draft/helpers/grpc_server.h index c788452cf9..af3a9df8fe 100644 --- a/tests/unit/client/draft/helpers/grpc_server.h +++ b/tests/unit/client/draft/helpers/grpc_server.h @@ -5,7 +5,7 @@ #include -namespace NYdb { +namespace NYdb::inline V3 { template std::unique_ptr StartGrpcServer(const std::string& address, TService& service) { diff --git a/tests/unit/client/draft/helpers/grpc_services/scripting.cpp b/tests/unit/client/draft/helpers/grpc_services/scripting.cpp index 1b172e179a..f798c05480 100644 --- a/tests/unit/client/draft/helpers/grpc_services/scripting.cpp +++ b/tests/unit/client/draft/helpers/grpc_services/scripting.cpp @@ -1,6 +1,6 @@ #include "scripting.h" -namespace NYdb::NScripting { +namespace NYdb::inline V3::NScripting { grpc::Status TMockSlyDbProxy::ExecuteYql( grpc::ServerContext* context, diff --git a/tests/unit/client/draft/helpers/grpc_services/scripting.h b/tests/unit/client/draft/helpers/grpc_services/scripting.h index 3e46a186f1..432e208549 100644 --- a/tests/unit/client/draft/helpers/grpc_services/scripting.h +++ b/tests/unit/client/draft/helpers/grpc_services/scripting.h @@ -2,7 +2,7 @@ #include -namespace NYdb::NScripting { +namespace NYdb::inline V3::NScripting { class TMockSlyDbProxy : public Ydb::Scripting::V1::ScriptingService::Service { diff --git a/tests/unit/client/draft/helpers/grpc_services/view.cpp b/tests/unit/client/draft/helpers/grpc_services/view.cpp index 3614fb5e4a..82e7335a9d 100644 --- a/tests/unit/client/draft/helpers/grpc_services/view.cpp +++ b/tests/unit/client/draft/helpers/grpc_services/view.cpp @@ -1,6 +1,6 @@ #include "view.h" -namespace NYdb::NView { +namespace NYdb::inline V3::NView { grpc::Status TViewDummyService::DescribeView( [[maybe_unused]] grpc::ServerContext* context, diff --git a/tests/unit/client/draft/helpers/grpc_services/view.h b/tests/unit/client/draft/helpers/grpc_services/view.h index 20a66e597f..e507ba61b6 100644 --- a/tests/unit/client/draft/helpers/grpc_services/view.h +++ b/tests/unit/client/draft/helpers/grpc_services/view.h @@ -2,7 +2,7 @@ #include -namespace NYdb::NView { +namespace NYdb::inline V3::NView { constexpr const char* DummyQueryText = "select 42"; diff --git a/tests/unit/client/draft/ydb_scripting_response_headers_ut.cpp b/tests/unit/client/draft/ydb_scripting_response_headers_ut.cpp index 9e350d1984..342b726b68 100644 --- a/tests/unit/client/draft/ydb_scripting_response_headers_ut.cpp +++ b/tests/unit/client/draft/ydb_scripting_response_headers_ut.cpp @@ -6,7 +6,7 @@ #include using namespace NYdb; -using namespace NYdb::NScripting; +using namespace NYdb::V3::NScripting; Y_UNIT_TEST_SUITE(ResponseHeaders) { Y_UNIT_TEST(PassHeader) { diff --git a/tests/unit/client/draft/ydb_view_ut.cpp b/tests/unit/client/draft/ydb_view_ut.cpp index 94336d1995..73ea9b90b6 100644 --- a/tests/unit/client/draft/ydb_view_ut.cpp +++ b/tests/unit/client/draft/ydb_view_ut.cpp @@ -6,7 +6,7 @@ #include using namespace NYdb; -using namespace NYdb::NView; +using namespace NYdb::V3::NView; Y_UNIT_TEST_SUITE(ViewClient) { Y_UNIT_TEST(Basic) { From e0eadcca39210080e5c79aaea32f1ef2b13ee76f Mon Sep 17 00:00:00 2001 From: alexnick88 Date: Mon, 9 Dec 2024 19:22:37 +0000 Subject: [PATCH 3/6] Moved commit "Add more fields in describe consumer in cpp sdk" from ydb repo --- .../ydb-cpp-sdk/client/topic/control_plane.h | 6 ++++++ src/client/topic/impl/topic.cpp | 15 +++++++++++++++ src/client/topic/ut/describe_topic_ut.cpp | 17 ++++++++++++++++- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/include/ydb-cpp-sdk/client/topic/control_plane.h b/include/ydb-cpp-sdk/client/topic/control_plane.h index 1424c0ae22..4e25523f9e 100644 --- a/include/ydb-cpp-sdk/client/topic/control_plane.h +++ b/include/ydb-cpp-sdk/client/topic/control_plane.h @@ -108,12 +108,18 @@ class TPartitionConsumerStats { uint64_t GetLastReadOffset() const; std::string GetReaderName() const; std::string GetReadSessionId() const; + const TInstant& GetLastReadTime() const; + const TDuration& GetMaxReadTimeLag() const; + const TDuration& GetMaxWriteTimeLag() const; private: uint64_t CommittedOffset_; int64_t LastReadOffset_; std::string ReaderName_; std::string ReadSessionId_; + TInstant LastReadTime_; + TDuration MaxReadTimeLag_; + TDuration MaxWriteTimeLag_; }; // Topic partition location diff --git a/src/client/topic/impl/topic.cpp b/src/client/topic/impl/topic.cpp index d11d8d33bd..ea3d0b59ee 100644 --- a/src/client/topic/impl/topic.cpp +++ b/src/client/topic/impl/topic.cpp @@ -351,6 +351,9 @@ TPartitionConsumerStats::TPartitionConsumerStats(const Ydb::Topic::DescribeConsu , LastReadOffset_(partitionStats.last_read_offset()) , ReaderName_(partitionStats.reader_name()) , ReadSessionId_(partitionStats.read_session_id()) + , LastReadTime_(TInstant::Seconds(partitionStats.last_read_time().seconds())) + , MaxReadTimeLag_(TDuration::Seconds(partitionStats.max_read_time_lag().seconds())) + , MaxWriteTimeLag_(TDuration::Seconds(partitionStats.max_write_time_lag().seconds())) {} uint64_t TPartitionConsumerStats::GetCommittedOffset() const { @@ -369,6 +372,18 @@ std::string TPartitionConsumerStats::GetReadSessionId() const { return ReadSessionId_; } +const TInstant& TPartitionConsumerStats::GetLastReadTime() const { + return LastReadTime_; +} + +const TDuration& TPartitionConsumerStats::GetMaxReadTimeLag() const { + return MaxReadTimeLag_; +} + +const TDuration& TPartitionConsumerStats::GetMaxWriteTimeLag() const { + return MaxWriteTimeLag_; +} + TPartitionLocation::TPartitionLocation(const Ydb::Topic::PartitionLocation& partitionLocation) : NodeId_(partitionLocation.node_id()) , Generation_(partitionLocation.generation()) diff --git a/src/client/topic/ut/describe_topic_ut.cpp b/src/client/topic/ut/describe_topic_ut.cpp index 4ab9c39585..39ae21ecbe 100644 --- a/src/client/topic/ut/describe_topic_ut.cpp +++ b/src/client/topic/ut/describe_topic_ut.cpp @@ -146,6 +146,7 @@ namespace NYdb::NTopic::NTests { UNIT_ASSERT_GT(consumerStats->GetCommittedOffset(), 0); UNIT_ASSERT_GE(TString{consumerStats->GetReadSessionId()}, 0); UNIT_ASSERT_VALUES_EQUAL(consumerStats->GetReaderName(), ""); + UNIT_ASSERT_GE(consumerStats->GetMaxWriteTimeLag(), TDuration::Seconds(100)); } else { UNIT_ASSERT_VALUES_EQUAL(stats->GetStartOffset(), 0); UNIT_ASSERT_VALUES_EQUAL(consumerStats->GetLastReadOffset(), 0); @@ -284,7 +285,7 @@ namespace NYdb::NTopic::NTests { std::string message(32_MB, 'x'); for(size_t i = 0; i < messagesCount; ++i) { - UNIT_ASSERT(writeSession->Write(message)); + UNIT_ASSERT(writeSession->Write(message, {}, TInstant::Now() - TDuration::Seconds(100))); } writeSession->Close(); } @@ -326,7 +327,21 @@ namespace NYdb::NTopic::NTests { } } + // Additional write + { + auto writeSettings = TWriteSessionSettings().Path(TEST_TOPIC).MessageGroupId(TEST_MESSAGE_GROUP_ID).Codec(ECodec::RAW); + auto writeSession = client.CreateSimpleBlockingWriteSession(writeSettings); + std::string message(32, 'x'); + + for(size_t i = 0; i < messagesCount; ++i) { + UNIT_ASSERT(writeSession->Write(message)); + } + writeSession->Close(); + } + Sleep(TDuration::Seconds(3)); + // Get non-empty description + DescribeTopic(setup, client, true, true, false, false); DescribeConsumer(setup, client, true, true, false, false); DescribePartition(setup, client, true, true, false, false); From 926b70d78f6431f37f649efa5fb61007cd1f0abc Mon Sep 17 00:00:00 2001 From: mregrock Date: Tue, 10 Dec 2024 12:36:32 +0000 Subject: [PATCH 4/6] Moved commit "Add ydb cli replace and fetch storage config commands" from ydb repo --- .../client/bsconfig/storage_config.h | 53 +++++++++++++++ src/client/CMakeLists.txt | 1 + src/client/bsconfig/CMakeLists.txt | 20 ++++++ src/client/bsconfig/storage_config.cpp | 67 +++++++++++++++++++ 4 files changed, 141 insertions(+) create mode 100644 include/ydb-cpp-sdk/client/bsconfig/storage_config.h create mode 100644 src/client/bsconfig/CMakeLists.txt create mode 100644 src/client/bsconfig/storage_config.cpp diff --git a/include/ydb-cpp-sdk/client/bsconfig/storage_config.h b/include/ydb-cpp-sdk/client/bsconfig/storage_config.h new file mode 100644 index 0000000000..4e6613df02 --- /dev/null +++ b/include/ydb-cpp-sdk/client/bsconfig/storage_config.h @@ -0,0 +1,53 @@ +#pragma once + +#include +#include +#include +#include +#include + +#include +#include + +namespace NYdb::inline V3::NStorageConfig { + +struct TFetchStorageConfigResult : public TStatus { + TFetchStorageConfigResult( + TStatus&& status, + std::string&& config) + : TStatus(std::move(status)) + , Config_(std::move(config)) + {} + + const std::string& GetConfig() const { + return Config_; + } + +private: + std::string Config_; +}; + +using TAsyncFetchStorageConfigResult = NThreading::TFuture; + +struct TStorageConfigSettings : public NYdb::TOperationRequestSettings {}; + +class TStorageConfigClient { +public: + + explicit TStorageConfigClient(const TDriver& driver, const TCommonClientSettings& settings = {}); + + ~TStorageConfigClient(); + + // Replace config + TAsyncStatus ReplaceStorageConfig(const std::string& config); + + // Fetch current cluster storage config + TAsyncFetchStorageConfigResult FetchStorageConfig(const TStorageConfigSettings& settings = {}); + +private: + class TImpl; + + std::unique_ptr Impl_; +}; + +} diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 736310d223..65426eeacc 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -1,3 +1,4 @@ +add_subdirectory(bsconfig) add_subdirectory(draft) add_subdirectory(helpers) add_subdirectory(iam) diff --git a/src/client/bsconfig/CMakeLists.txt b/src/client/bsconfig/CMakeLists.txt new file mode 100644 index 0000000000..961a3327a6 --- /dev/null +++ b/src/client/bsconfig/CMakeLists.txt @@ -0,0 +1,20 @@ +_ydb_sdk_add_library(client-bsconfig) + +target_link_libraries(client-bsconfig + PUBLIC + client-ydb_driver + client-ydb_common_client + client-ydb_types-status + client-ydb_types + PRIVATE + api-grpc + impl-ydb_internal-make_request + client-ydb_common_client-impl +) + +target_sources(client-bsconfig + PRIVATE + storage_config.cpp +) + +_ydb_sdk_make_client_component(BSConfig client-bsconfig) diff --git a/src/client/bsconfig/storage_config.cpp b/src/client/bsconfig/storage_config.cpp new file mode 100644 index 0000000000..3f729eaa4d --- /dev/null +++ b/src/client/bsconfig/storage_config.cpp @@ -0,0 +1,67 @@ +#include + +#include +#include + +#include + +namespace NYdb::inline V3::NStorageConfig { + +class TStorageConfigClient::TImpl : public TClientImplCommon { +public: + TImpl(std::shared_ptr connections, const TCommonClientSettings& settings) + : TClientImplCommon(std::move(connections), settings) + { + } + + TAsyncStatus ReplaceStorageConfig(const std::string& config) { + auto request = MakeRequest(); + request.set_yaml_config(config); + + return RunSimple( + std::move(request), + &Ydb::BSConfig::V1::BSConfigService::Stub::AsyncReplaceStorageConfig); + } + + TAsyncFetchStorageConfigResult FetchStorageConfig(const TStorageConfigSettings& settings = {}) { + auto request = MakeOperationRequest(settings); + auto promise = NThreading::NewPromise(); + + auto extractor = [promise] (google::protobuf::Any* any, TPlainStatus status) mutable { + NYdb::TStringType config; + if (Ydb::BSConfig::FetchStorageConfigResult result; any && any->UnpackTo(&result)) { + config = result.yaml_config(); + } + + TFetchStorageConfigResult val(TStatus(std::move(status)), std::string{std::move(config)}); + promise.SetValue(std::move(val)); + }; + + Connections_->RunDeferred( + std::move(request), + extractor, + &Ydb::BSConfig::V1::BSConfigService::Stub::AsyncFetchStorageConfig, + DbDriverState_, + INITIAL_DEFERRED_CALL_DELAY, + TRpcRequestSettings::Make(settings)); + return promise.GetFuture(); + } + +}; + +TStorageConfigClient::TStorageConfigClient(const TDriver& driver, const TCommonClientSettings& settings) + : Impl_(new TStorageConfigClient::TImpl(CreateInternalInterface(driver), settings)) +{} + +TStorageConfigClient::~TStorageConfigClient() = default; + +TAsyncStatus TStorageConfigClient::ReplaceStorageConfig(const std::string& config) { + return Impl_->ReplaceStorageConfig(config); +} + +TAsyncFetchStorageConfigResult TStorageConfigClient::FetchStorageConfig(const TStorageConfigSettings& settings) { + return Impl_->FetchStorageConfig(settings); +} + + +} From 65efc800828a72d676d7c93d7dbd2eb8d31f7424 Mon Sep 17 00:00:00 2001 From: Bulat Gayazov Date: Thu, 12 Dec 2024 18:34:59 +0000 Subject: [PATCH 5/6] Added ThrowOnError helper for TStatus --- examples/basic_example/basic_example.cpp | 23 ++-------------- examples/pagination/pagination.cpp | 23 ++-------------- examples/secondary_index/main.cpp | 3 ++- examples/secondary_index/secondary_index.h | 27 ------------------- .../secondary_index_create.cpp | 1 + .../secondary_index_delete.cpp | 1 + .../secondary_index/secondary_index_drop.cpp | 1 + .../secondary_index_generate.cpp | 1 + .../secondary_index/secondary_index_list.cpp | 1 + .../secondary_index_update.cpp | 1 + examples/secondary_index_builtin/main.cpp | 3 ++- .../secondary_index_builtin/secondary_index.h | 24 ----------------- .../secondary_index_create.cpp | 1 + .../secondary_index_drop.cpp | 1 + .../secondary_index_fill.cpp | 1 + .../secondary_index_select.cpp | 1 + .../secondary_index_select_join.cpp | 1 + examples/topic_writer/transaction/main.cpp | 9 ------- examples/ttl/main.cpp | 1 + examples/ttl/ttl.cpp | 4 +-- examples/ttl/util.h | 19 ------------- include/ydb-cpp-sdk/client/table/table.h | 4 +-- .../ydb-cpp-sdk/client/types/status/status.h | 24 +++++++++++++++++ src/client/types/status/status.cpp | 22 +++++++++++++++ .../basic_example_it/basic_example.cpp | 26 +++++++----------- .../basic_example_it/basic_example.h | 8 ------ tests/integration/basic_example_it/main.cpp | 6 ++--- .../bulk_upsert_simple_it/bulk_upsert.cpp | 12 +++------ .../bulk_upsert_simple_it/bulk_upsert.h | 8 ------ .../bulk_upsert_simple_it/main.cpp | 7 +++-- 30 files changed, 89 insertions(+), 175 deletions(-) diff --git a/examples/basic_example/basic_example.cpp b/examples/basic_example/basic_example.cpp index 13d5930b9c..126f9eecd1 100644 --- a/examples/basic_example/basic_example.cpp +++ b/examples/basic_example/basic_example.cpp @@ -8,25 +8,7 @@ using namespace NYdb; using namespace NYdb::NQuery; - -class TYdbErrorException : public yexception { -public: - TYdbErrorException(const TStatus& status) - : Status(status) {} - - TStatus Status; -}; - -static void ThrowOnError(const TStatus& status) { - if (!status.IsSuccess()) { - throw TYdbErrorException(status) << status; - } -} - -static void PrintStatus(const TStatus& status) { - std::cerr << "Status: " << ToString(status.GetStatus()) << std::endl; - std::cerr << status.GetIssues().ToString(); -} +using namespace NYdb::NStatusHelpers; template std::string OptionalToString(const std::optional& opt) { @@ -502,8 +484,7 @@ bool Run(const TDriver& driver) { DropTables(client); } catch (const TYdbErrorException& e) { - std::cerr << "Execution failed due to fatal error:" << std::endl; - PrintStatus(e.Status); + std::cerr << "Execution failed due to fatal error: " << e.what() << std::endl; return false; } diff --git a/examples/pagination/pagination.cpp b/examples/pagination/pagination.cpp index c6080b9df7..4a1a1300db 100644 --- a/examples/pagination/pagination.cpp +++ b/examples/pagination/pagination.cpp @@ -7,28 +7,10 @@ using namespace NYdb; using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; const uint32_t MaxPages = 10; -class TYdbErrorException : public yexception { -public: - TYdbErrorException(const TStatus& status) - : Status(status) {} - - TStatus Status; -}; - -static void ThrowOnError(const TStatus& status) { - if (!status.IsSuccess()) { - throw TYdbErrorException(status) << status; - } -} - -static void PrintStatus(const TStatus& status) { - std::cerr << "Status: " << ToString(status.GetStatus()) << std::endl; - std::cerr << status.GetIssues().ToString(); -} - static std::string JoinPath(const std::string& basePath, const std::string& path) { if (basePath.empty()) { return path; @@ -184,8 +166,7 @@ bool Run(const TDriver& driver, const std::string& path) { } } catch (const TYdbErrorException& e) { - std::cerr << "Execution failed due to fatal error:" << std::endl; - PrintStatus(e.Status); + std::cerr << "Execution failed due to fatal error: " << e.what() << std::endl; return false; } diff --git a/examples/secondary_index/main.cpp b/examples/secondary_index/main.cpp index bd48d107cf..3fb520bb21 100644 --- a/examples/secondary_index/main.cpp +++ b/examples/secondary_index/main.cpp @@ -2,6 +2,7 @@ using namespace NLastGetopt; using namespace NYdb; +using namespace NYdb::NStatusHelpers; //////////////////////////////////////////////////////////////////////////////// @@ -61,7 +62,7 @@ int main(int argc, char** argv) { return RunDeleteSeries(driver, prefix, argc, argv); } } catch (const TYdbErrorException& e) { - std::cerr << "Execution failed: " << e << std::endl; + std::cerr << "Execution failed: " << e.what() << std::endl; return 1; } diff --git a/examples/secondary_index/secondary_index.h b/examples/secondary_index/secondary_index.h index 755ba617fb..273b4edc26 100644 --- a/examples/secondary_index/secondary_index.h +++ b/examples/secondary_index/secondary_index.h @@ -41,33 +41,6 @@ std::string JoinPath(const std::string& prefix, const std::string& path); //////////////////////////////////////////////////////////////////////////////// -class TYdbErrorException : public yexception { -public: - TYdbErrorException(NYdb::TStatus status) - : Status(std::move(status)) - { } - - friend std::ostream& operator<<(std::ostream& out, const TYdbErrorException& e) { - out << "Status: " << ToString(e.Status.GetStatus()); - if (e.Status.GetIssues()) { - out << std::endl; - out << e.Status.GetIssues().ToString(); - } - return out; - } - -private: - NYdb::TStatus Status; -}; - -inline void ThrowOnError(NYdb::TStatus status) { - if (!status.IsSuccess()) { - throw TYdbErrorException(status) << status; - } -} - -//////////////////////////////////////////////////////////////////////////////// - int RunCreateTables(NYdb::TDriver& driver, const std::string& prefix, int argc, char** argv); int RunDropTables(NYdb::TDriver& driver, const std::string& prefix, int argc, char** argv); int RunUpdateViews(NYdb::TDriver& driver, const std::string& prefix, int argc, char** argv); diff --git a/examples/secondary_index/secondary_index_create.cpp b/examples/secondary_index/secondary_index_create.cpp index 3b0151a003..ac0f556967 100644 --- a/examples/secondary_index/secondary_index_create.cpp +++ b/examples/secondary_index/secondary_index_create.cpp @@ -3,6 +3,7 @@ using namespace NLastGetopt; using namespace NYdb; using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; //////////////////////////////////////////////////////////////////////////////// diff --git a/examples/secondary_index/secondary_index_delete.cpp b/examples/secondary_index/secondary_index_delete.cpp index 6fe7719f62..5f38f76f0a 100644 --- a/examples/secondary_index/secondary_index_delete.cpp +++ b/examples/secondary_index/secondary_index_delete.cpp @@ -3,6 +3,7 @@ using namespace NLastGetopt; using namespace NYdb; using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; //////////////////////////////////////////////////////////////////////////////// diff --git a/examples/secondary_index/secondary_index_drop.cpp b/examples/secondary_index/secondary_index_drop.cpp index c6b7f84ca6..d7531786d4 100644 --- a/examples/secondary_index/secondary_index_drop.cpp +++ b/examples/secondary_index/secondary_index_drop.cpp @@ -3,6 +3,7 @@ using namespace NLastGetopt; using namespace NYdb; using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; //////////////////////////////////////////////////////////////////////////////// diff --git a/examples/secondary_index/secondary_index_generate.cpp b/examples/secondary_index/secondary_index_generate.cpp index 4307f112c9..7039816692 100644 --- a/examples/secondary_index/secondary_index_generate.cpp +++ b/examples/secondary_index/secondary_index_generate.cpp @@ -8,6 +8,7 @@ using namespace NLastGetopt; using namespace NYdb; using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; namespace { diff --git a/examples/secondary_index/secondary_index_list.cpp b/examples/secondary_index/secondary_index_list.cpp index e1502f5274..59e127d8ba 100644 --- a/examples/secondary_index/secondary_index_list.cpp +++ b/examples/secondary_index/secondary_index_list.cpp @@ -5,6 +5,7 @@ using namespace NLastGetopt; using namespace NYdb; using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; //////////////////////////////////////////////////////////////////////////////// diff --git a/examples/secondary_index/secondary_index_update.cpp b/examples/secondary_index/secondary_index_update.cpp index 52a1b22fe5..f040b192a0 100644 --- a/examples/secondary_index/secondary_index_update.cpp +++ b/examples/secondary_index/secondary_index_update.cpp @@ -3,6 +3,7 @@ using namespace NLastGetopt; using namespace NYdb; using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; //////////////////////////////////////////////////////////////////////////////// diff --git a/examples/secondary_index_builtin/main.cpp b/examples/secondary_index_builtin/main.cpp index 4766077815..331ad7ed53 100644 --- a/examples/secondary_index_builtin/main.cpp +++ b/examples/secondary_index_builtin/main.cpp @@ -2,6 +2,7 @@ using namespace NLastGetopt; using namespace NYdb; +using namespace NYdb::NStatusHelpers; int main(int argc, char** argv) { @@ -56,7 +57,7 @@ int main(int argc, char** argv) { } } catch (const TYdbErrorException& e) { - std::cerr << "Execution failed: " << e << std::endl; + std::cerr << "Execution failed: " << e.what() << std::endl; return 1; } } diff --git a/examples/secondary_index_builtin/secondary_index.h b/examples/secondary_index_builtin/secondary_index.h index f32bf8799d..ed22b2a28d 100644 --- a/examples/secondary_index_builtin/secondary_index.h +++ b/examples/secondary_index_builtin/secondary_index.h @@ -52,30 +52,6 @@ struct TSeries { , UploadedUserId(uploadedUserId) {} }; -class TYdbErrorException: public yexception { -public: - TYdbErrorException(NYdb::TStatus status) - : Status(std::move(status)) - { } - - friend std::ostream& operator<<(std::ostream& out, const TYdbErrorException& e) { - out << "Status:" << ToString(e.Status.GetStatus()); - if (e.Status.GetIssues()) { - out << std::endl; - out << e.Status.GetIssues().ToString(); - } - return out; - } -private: - NYdb::TStatus Status; -}; - -inline void ThrowOnError(NYdb::TStatus status) { - if (!status.IsSuccess()){ - throw TYdbErrorException(status) << status; - } -} - std::string GetCommandsList(); TCommand Parse(const char *stringCmnd); std::string JoinPath(const std::string& prefix, const std::string& path); diff --git a/examples/secondary_index_builtin/secondary_index_create.cpp b/examples/secondary_index_builtin/secondary_index_create.cpp index 95bac95b18..5b794b6dbd 100644 --- a/examples/secondary_index_builtin/secondary_index_create.cpp +++ b/examples/secondary_index_builtin/secondary_index_create.cpp @@ -2,6 +2,7 @@ using namespace NYdb; using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; using namespace NLastGetopt; static void CreateSeriesTable(TTableClient& client, const std::string& path) { diff --git a/examples/secondary_index_builtin/secondary_index_drop.cpp b/examples/secondary_index_builtin/secondary_index_drop.cpp index e04da7ff16..06d5be52b1 100644 --- a/examples/secondary_index_builtin/secondary_index_drop.cpp +++ b/examples/secondary_index_builtin/secondary_index_drop.cpp @@ -1,6 +1,7 @@ #include "secondary_index.h" using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; using namespace NYdb; static void DropTable(TTableClient& client, const std::string& path) { diff --git a/examples/secondary_index_builtin/secondary_index_fill.cpp b/examples/secondary_index_builtin/secondary_index_fill.cpp index 2da2605263..6747e2f06f 100644 --- a/examples/secondary_index_builtin/secondary_index_fill.cpp +++ b/examples/secondary_index_builtin/secondary_index_fill.cpp @@ -4,6 +4,7 @@ using namespace NYdb; using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; std::vector GetSeries() { std::vector series = { diff --git a/examples/secondary_index_builtin/secondary_index_select.cpp b/examples/secondary_index_builtin/secondary_index_select.cpp index bba83d6deb..a659984624 100644 --- a/examples/secondary_index_builtin/secondary_index_select.cpp +++ b/examples/secondary_index_builtin/secondary_index_select.cpp @@ -2,6 +2,7 @@ using namespace NYdb; using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; using namespace NLastGetopt; TStatus SelectSeriesWithViews(TSession session, const std::string& path, std::vector& selectResult, uint64_t minViews) { diff --git a/examples/secondary_index_builtin/secondary_index_select_join.cpp b/examples/secondary_index_builtin/secondary_index_select_join.cpp index f93a62c167..d2874e121d 100644 --- a/examples/secondary_index_builtin/secondary_index_select_join.cpp +++ b/examples/secondary_index_builtin/secondary_index_select_join.cpp @@ -2,6 +2,7 @@ using namespace NYdb; using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; using namespace NLastGetopt; TStatus SelectSeriesWithUserName(TSession session, const std::string& path, diff --git a/examples/topic_writer/transaction/main.cpp b/examples/topic_writer/transaction/main.cpp index 23ffdbbb1c..c98c8df8e1 100644 --- a/examples/topic_writer/transaction/main.cpp +++ b/examples/topic_writer/transaction/main.cpp @@ -1,15 +1,6 @@ #include #include -void ThrowOnError(const NYdb::TStatus& status) -{ - if (status.IsSuccess()) { - return; - } - - ythrow yexception() << status; -} - int main() { const std::string ENDPOINT = "HOST:PORT"; diff --git a/examples/ttl/main.cpp b/examples/ttl/main.cpp index 1d98c1c01d..031a06d737 100644 --- a/examples/ttl/main.cpp +++ b/examples/ttl/main.cpp @@ -4,6 +4,7 @@ using namespace NLastGetopt; using namespace NYdb; +using namespace NYdb::NStatusHelpers; void StopHandler(int) { exit(1); diff --git a/examples/ttl/ttl.cpp b/examples/ttl/ttl.cpp index bc6086ab5d..9ec2eafd5b 100644 --- a/examples/ttl/ttl.cpp +++ b/examples/ttl/ttl.cpp @@ -6,6 +6,7 @@ using namespace NExample; using namespace NYdb; using namespace NYdb::NTable; +using namespace NYdb::NStatusHelpers; constexpr uint32_t DOC_TABLE_PARTITION_COUNT = 4; constexpr uint32_t EXPIRATION_QUEUE_COUNT = 4; @@ -334,8 +335,7 @@ bool Run(const TDriver& driver, const std::string& path) { ReadDocument(client, path, "https://ya.ru/"); } catch (const TYdbErrorException& e) { - std::cerr << "Execution failed due to fatal error:" << std::endl; - PrintStatus(e.Status); + std::cerr << "Execution failed due to fatal error: " << e.what() << std::endl; return false; } diff --git a/examples/ttl/util.h b/examples/ttl/util.h index 5c25a660dd..a2a8bd3256 100644 --- a/examples/ttl/util.h +++ b/examples/ttl/util.h @@ -12,25 +12,6 @@ namespace NExample { using namespace NYdb; using namespace NYdb::NTable; -class TYdbErrorException : public yexception { -public: - TYdbErrorException(const TStatus& status) - : Status(status) {} - - TStatus Status; -}; - -inline void ThrowOnError(const TStatus& status) { - if (!status.IsSuccess()) { - throw TYdbErrorException(status) << status; - } -} - -inline void PrintStatus(const TStatus& status) { - std::cerr << "Status: " << ToString(status.GetStatus()) << std::endl; - std::cerr << status.GetIssues().ToString(); -} - inline std::string JoinPath(const std::string& basePath, const std::string& path) { if (basePath.empty()) { return path; diff --git a/include/ydb-cpp-sdk/client/table/table.h b/include/ydb-cpp-sdk/client/table/table.h index df587ff3b1..5066619241 100644 --- a/include/ydb-cpp-sdk/client/table/table.h +++ b/include/ydb-cpp-sdk/client/table/table.h @@ -1098,8 +1098,8 @@ using TAsyncScanQueryPartIterator = NThreading::TFuture; struct TCreateSessionSettings : public TOperationRequestSettings {}; -using TBackoffSettings = NYdb::NRetry::TBackoffSettings; -using TRetryOperationSettings = NYdb::NRetry::TRetryOperationSettings; +using TBackoffSettings = NYdb::V3::NRetry::TBackoffSettings; +using TRetryOperationSettings = NYdb::V3::NRetry::TRetryOperationSettings; struct TSessionPoolSettings { using TSelf = TSessionPoolSettings; diff --git a/include/ydb-cpp-sdk/client/types/status/status.h b/include/ydb-cpp-sdk/client/types/status/status.h index 1f8dceb43b..41af8ffb66 100644 --- a/include/ydb-cpp-sdk/client/types/status/status.h +++ b/include/ydb-cpp-sdk/client/types/status/status.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include @@ -45,4 +46,27 @@ class TStreamPartStatus : public TStatus { bool EOS() const; }; +namespace NStatusHelpers { + +class TYdbErrorException : public TYdbException { +public: + TYdbErrorException(TStatus status) + : Status_(std::move(status)) + { + *this << status; + } + + friend IOutputStream& operator<<(IOutputStream& out, const TYdbErrorException& e) { + return out << e.Status_; + } + +private: + TStatus Status_; +}; + +void ThrowOnError(TStatus status, std::function onSuccess = [](TStatus) {}); +void ThrowOnErrorOrPrintIssues(TStatus status); + +} + } // namespace NYdb diff --git a/src/client/types/status/status.cpp b/src/client/types/status/status.cpp index fb94a9b704..1764499e40 100644 --- a/src/client/types/status/status.cpp +++ b/src/client/types/status/status.cpp @@ -99,4 +99,26 @@ bool TStreamPartStatus::EOS() const { return GetStatus() == EStatus::CLIENT_OUT_OF_RANGE; } +//////////////////////////////////////////////////////////////////////////////// + +namespace NStatusHelpers { + +void ThrowOnError(TStatus status, std::function onSuccess) { + if (!status.IsSuccess()) { + throw TYdbErrorException(status) << status; + } else { + onSuccess(status); + } +} + +void ThrowOnErrorOrPrintIssues(TStatus status) { + ThrowOnError(status, [](TStatus status) { + if (status.GetIssues()) { + std::cerr << ToString(status); + } + }); +} + +} + } // namespace NYdb diff --git a/tests/integration/basic_example_it/basic_example.cpp b/tests/integration/basic_example_it/basic_example.cpp index c8a2eb8b88..f712001a55 100644 --- a/tests/integration/basic_example_it/basic_example.cpp +++ b/tests/integration/basic_example_it/basic_example.cpp @@ -7,12 +7,6 @@ using namespace NYdb::NTable; -void ThrowOnError(const NYdb::TStatus& status) { - if (!status.IsSuccess()) { - throw TYdbErrorException(status) << status; - } -} - static std::string JoinPath(const std::string& basePath, const std::string& path) { if (basePath.empty()) { return path; @@ -41,7 +35,7 @@ TRunArgs GetRunArgs() { //! Creates sample tables with CrateTable API. void CreateTables(TTableClient client, const std::string& path) { - ThrowOnError(client.RetryOperationSync([path](TSession session) { + NYdb::NStatusHelpers::ThrowOnError(client.RetryOperationSync([path](TSession session) { auto seriesDesc = TTableBuilder() .AddNullableColumn("series_id", NYdb::EPrimitiveType::Uint64) .AddNullableColumn("title", NYdb::EPrimitiveType::Utf8) @@ -53,7 +47,7 @@ void CreateTables(TTableClient client, const std::string& path) { return session.CreateTable(JoinPath(path, "series"), std::move(seriesDesc)).GetValueSync(); })); - ThrowOnError(client.RetryOperationSync([path](TSession session) { + NYdb::NStatusHelpers::ThrowOnError(client.RetryOperationSync([path](TSession session) { auto seasonsDesc = TTableBuilder() .AddNullableColumn("series_id", NYdb::EPrimitiveType::Uint64) .AddNullableColumn("season_id", NYdb::EPrimitiveType::Uint64) @@ -66,7 +60,7 @@ void CreateTables(TTableClient client, const std::string& path) { return session.CreateTable(JoinPath(path, "seasons"), std::move(seasonsDesc)).GetValueSync(); })); - ThrowOnError(client.RetryOperationSync([path](TSession session) { + NYdb::NStatusHelpers::ThrowOnError(client.RetryOperationSync([path](TSession session) { auto episodesDesc = TTableBuilder() .AddNullableColumn("series_id", NYdb::EPrimitiveType::Uint64) .AddNullableColumn("season_id", NYdb::EPrimitiveType::Uint64) @@ -466,7 +460,7 @@ static NYdb::TStatus ScanQuerySelect(TTableClient client, const std::string& pat NYdb::TResultSet SelectSimple(TTableClient client, const std::string& path) { std::optional resultSet; - ThrowOnError(client.RetryOperationSync([path, &resultSet](TSession session) { + NYdb::NStatusHelpers::ThrowOnError(client.RetryOperationSync([path, &resultSet](TSession session) { return SelectSimpleTransaction(session, path, resultSet); })); @@ -474,14 +468,14 @@ NYdb::TResultSet SelectSimple(TTableClient client, const std::string& path) { } void UpsertSimple(TTableClient client, const std::string& path) { - ThrowOnError(client.RetryOperationSync([path](TSession session) { + NYdb::NStatusHelpers::ThrowOnError(client.RetryOperationSync([path](TSession session) { return UpsertSimpleTransaction(session, path); })); } NYdb::TResultSet SelectWithParams(TTableClient client, const std::string& path) { std::optional resultSet; - ThrowOnError(client.RetryOperationSync([path, &resultSet](TSession session) { + NYdb::NStatusHelpers::ThrowOnError(client.RetryOperationSync([path, &resultSet](TSession session) { return SelectWithParamsTransaction(session, path, 2, 3, resultSet); })); @@ -490,7 +484,7 @@ NYdb::TResultSet SelectWithParams(TTableClient client, const std::string& path) NYdb::TResultSet PreparedSelect(TTableClient client, const std::string& path, ui32 seriesId, ui32 seasonId, ui32 episodeId) { std::optional resultSet; - ThrowOnError(client.RetryOperationSync([path, seriesId, seasonId, episodeId, &resultSet](TSession session) { + NYdb::NStatusHelpers::ThrowOnError(client.RetryOperationSync([path, seriesId, seasonId, episodeId, &resultSet](TSession session) { return PreparedSelectTransaction(session, path, seriesId, seasonId, episodeId, resultSet); })); @@ -499,7 +493,7 @@ NYdb::TResultSet PreparedSelect(TTableClient client, const std::string& path, ui NYdb::TResultSet MultiStep(TTableClient client, const std::string& path) { std::optional resultSet; - ThrowOnError(client.RetryOperationSync([path, &resultSet](TSession session) { + NYdb::NStatusHelpers::ThrowOnError(client.RetryOperationSync([path, &resultSet](TSession session) { return MultiStepTransaction(session, path, 2, 5, resultSet); })); @@ -507,14 +501,14 @@ NYdb::TResultSet MultiStep(TTableClient client, const std::string& path) { } void ExplicitTcl(TTableClient client, const std::string& path) { - ThrowOnError(client.RetryOperationSync([path](TSession session) { + NYdb::NStatusHelpers::ThrowOnError(client.RetryOperationSync([path](TSession session) { return ExplicitTclTransaction(session, path, TInstant()); })); } std::vector ScanQuerySelect(TTableClient client, const std::string& path) { std::vector resultSets; - ThrowOnError(client.RetryOperationSync([path, &resultSets](TTableClient& client) { + NYdb::NStatusHelpers::ThrowOnError(client.RetryOperationSync([path, &resultSets](TTableClient& client) { return ScanQuerySelect(client, path, resultSets); })); diff --git a/tests/integration/basic_example_it/basic_example.h b/tests/integration/basic_example_it/basic_example.h index 6a59cdd2fe..e35fba6994 100644 --- a/tests/integration/basic_example_it/basic_example.h +++ b/tests/integration/basic_example_it/basic_example.h @@ -13,18 +13,10 @@ struct TRunArgs { NYdb::TDriver driver; std::string path; }; -class TYdbErrorException : public yexception { -public: - TYdbErrorException(const NYdb::TStatus& status) - : Status(status) {} - - NYdb::TStatus Status; -}; NYdb::TParams GetTablesDataParams(); void CreateTables(TTableClient client, const std::string& path); -void ThrowOnError(const NYdb::TStatus& status); TRunArgs GetRunArgs(); NYdb::TStatus FillTableDataTransaction(TSession session, const std::string& path); NYdb::TResultSet SelectSimple(TTableClient client, const std::string& path); diff --git a/tests/integration/basic_example_it/main.cpp b/tests/integration/basic_example_it/main.cpp index 15417a6f45..4ad89b4377 100644 --- a/tests/integration/basic_example_it/main.cpp +++ b/tests/integration/basic_example_it/main.cpp @@ -46,7 +46,7 @@ TEST(Integration, BasicExample) { try { CreateTables(client, path); - ThrowOnError(client.RetryOperationSync([path](NYdb::NTable::TSession session) { + NYdb::NStatusHelpers::ThrowOnError(client.RetryOperationSync([path](NYdb::NTable::TSession session) { return FillTableDataTransaction(session, path); })); @@ -216,7 +216,7 @@ TEST(Integration, BasicExample) { ASSERT_EQ(result.size(), size_t(1)); ValidateResultSet(columns, values, result[0]); } - } catch (const TYdbErrorException& e) { - FAIL() << "Execution failed due to fatal error:\nStatus: " << ToString(e.Status) << std::endl; + } catch (const NYdb::NStatusHelpers::TYdbErrorException& e) { + FAIL() << "Execution failed due to fatal error:\n" << e.what() << std::endl; } } diff --git a/tests/integration/bulk_upsert_simple_it/bulk_upsert.cpp b/tests/integration/bulk_upsert_simple_it/bulk_upsert.cpp index 29956dd8b0..ce74b1cc16 100644 --- a/tests/integration/bulk_upsert_simple_it/bulk_upsert.cpp +++ b/tests/integration/bulk_upsert_simple_it/bulk_upsert.cpp @@ -5,12 +5,6 @@ static constexpr size_t BATCH_SIZE = 1000; -static void ThrowOnError(const TStatus& status) { - if (!status.IsSuccess()) { - throw TYdbErrorException(status) << status; - } -} - static std::string JoinPath(const std::string& basePath, const std::string& path) { if (basePath.empty()) { return path; @@ -133,7 +127,7 @@ static TStatus SelectTransaction(TSession session, const std::string& path, TStatistic Select(TTableClient& client, const std::string& path) { std::optional resultSet; - ThrowOnError(client.RetryOperationSync([path, &resultSet](TSession session) { + NStatusHelpers::ThrowOnError(client.RetryOperationSync([path, &resultSet](TSession session) { return SelectTransaction(session, path, resultSet); })); @@ -144,7 +138,7 @@ TStatistic Select(TTableClient& client, const std::string& path) { uint64_t rowCount = 0; if (parser.ColumnsCount() != 3 || parser.RowsCount() != 1) { - throw TYdbErrorException(TStatus(EStatus::GENERIC_ERROR, + throw NStatusHelpers::TYdbErrorException(TStatus(EStatus::GENERIC_ERROR, {NYdb::NIssue::TIssue("The number of columns should be: 3.\nThe number of rows should be: 1")})); } @@ -158,7 +152,7 @@ TStatistic Select(TTableClient& client, const std::string& path) { } void DropTable(TTableClient& client, const std::string& path) { - ThrowOnError(client.RetryOperationSync([path](TSession session) { + NStatusHelpers::ThrowOnError(client.RetryOperationSync([path](TSession session) { return session.DropTable(path).ExtractValueSync(); })); } diff --git a/tests/integration/bulk_upsert_simple_it/bulk_upsert.h b/tests/integration/bulk_upsert_simple_it/bulk_upsert.h index e450973a61..e6d13a5d7f 100644 --- a/tests/integration/bulk_upsert_simple_it/bulk_upsert.h +++ b/tests/integration/bulk_upsert_simple_it/bulk_upsert.h @@ -24,14 +24,6 @@ struct TLogMessage { std::string Message; }; -class TYdbErrorException : public yexception { -public: - TYdbErrorException(const NYdb::TStatus& status) - : Status(status) {} - - NYdb::TStatus Status; -}; - struct TStatistic { uint64_t SumApp; uint64_t SumHost; diff --git a/tests/integration/bulk_upsert_simple_it/main.cpp b/tests/integration/bulk_upsert_simple_it/main.cpp index 5342987c71..589f0ff3d9 100644 --- a/tests/integration/bulk_upsert_simple_it/main.cpp +++ b/tests/integration/bulk_upsert_simple_it/main.cpp @@ -44,12 +44,11 @@ TEST(Integration, BulkUpsert) { EXPECT_EQ(rowCount, correctRowCount); EXPECT_EQ(sumApp, correctSumApp); EXPECT_EQ(sumHost, correctSumHost); - } catch (const TYdbErrorException& e) { + } catch (const NYdb::NStatusHelpers::TYdbErrorException& e) { driver.Stop(true); - FAIL() << "Execution failed due to fatal error:\nStatus: " << ToString(e.Status) << std::endl << e.Status.GetIssues().ToString(); + FAIL() << "Execution failed due to fatal error:\n" << e.what() << std::endl; } - + DropTable(client, path); driver.Stop(true); - } From fe9c82a9d2f0c612faecaae03f69732d1c0e4890 Mon Sep 17 00:00:00 2001 From: stanislav_shchetinin Date: Thu, 12 Dec 2024 18:36:03 +0000 Subject: [PATCH 6/6] Moved commit "Backup changefeed configurations (tools dump)" from ydb repo --- include/ydb-cpp-sdk/client/table/table.h | 4 +++ src/client/table/table.cpp | 31 +++++++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/include/ydb-cpp-sdk/client/table/table.h b/include/ydb-cpp-sdk/client/table/table.h index 5066619241..03832a2097 100644 --- a/include/ydb-cpp-sdk/client/table/table.h +++ b/include/ydb-cpp-sdk/client/table/table.h @@ -395,9 +395,13 @@ class TChangefeedDescription { const std::optional& GetInitialScanProgress() const; void SerializeTo(Ydb::Table::Changefeed& proto) const; + void SerializeTo(Ydb::Table::ChangefeedDescription& proto) const; std::string ToString() const; void Out(IOutputStream& o) const; + template + void SerializeCommonFields(TProto& proto) const; + private: explicit TChangefeedDescription(const Ydb::Table::Changefeed& proto); explicit TChangefeedDescription(const Ydb::Table::ChangefeedDescription& proto); diff --git a/src/client/table/table.cpp b/src/client/table/table.cpp index 7ca0df537a..8b2256200a 100644 --- a/src/client/table/table.cpp +++ b/src/client/table/table.cpp @@ -2817,10 +2817,10 @@ TChangefeedDescription TChangefeedDescription::FromProto(const TProto& proto) { return ret; } -void TChangefeedDescription::SerializeTo(Ydb::Table::Changefeed& proto) const { +template +void TChangefeedDescription::SerializeCommonFields(TProto& proto) const { proto.set_name(TStringType{Name_}); proto.set_virtual_timestamps(VirtualTimestamps_); - proto.set_initial_scan(InitialScan_); proto.set_aws_region(TStringType{AwsRegion_}); switch (Mode_) { @@ -2861,12 +2861,35 @@ void TChangefeedDescription::SerializeTo(Ydb::Table::Changefeed& proto) const { SetDuration(*ResolvedTimestamps_, *proto.mutable_resolved_timestamps_interval()); } + for (const auto& [key, value] : Attributes_) { + (*proto.mutable_attributes())[key] = value; + } +} + +void TChangefeedDescription::SerializeTo(Ydb::Table::Changefeed& proto) const { + SerializeCommonFields(proto); + proto.set_initial_scan(InitialScan_); + if (RetentionPeriod_) { SetDuration(*RetentionPeriod_, *proto.mutable_retention_period()); } +} - for (const auto& [key, value] : Attributes_) { - (*proto.mutable_attributes())[key] = value; +void TChangefeedDescription::SerializeTo(Ydb::Table::ChangefeedDescription& proto) const { + SerializeCommonFields(proto); + + switch (State_) { + case EChangefeedState::Enabled: + proto.set_state(Ydb::Table::ChangefeedDescription_State::ChangefeedDescription_State_STATE_ENABLED); + break; + case EChangefeedState::Disabled: + proto.set_state(Ydb::Table::ChangefeedDescription_State::ChangefeedDescription_State_STATE_DISABLED); + break; + case EChangefeedState::InitialScan: + proto.set_state(Ydb::Table::ChangefeedDescription_State::ChangefeedDescription_State_STATE_INITIAL_SCAN); + break; + case EChangefeedState::Unknown: + break; } }