diff options
author | capone212 <capone212@yandex-team.com> | 2023-12-15 01:59:50 +0300 |
---|---|---|
committer | capone212 <capone212@yandex-team.com> | 2023-12-15 02:24:58 +0300 |
commit | 3f6d35b868f1e4d8c4c0ea6f3fd42be487f5a448 (patch) | |
tree | f62a8ad6b47c2b533cc36d2612655aa67c94e32a | |
parent | 03dfc91f6bc1ebd03260d47c8199d3a08cb78023 (diff) | |
download | ydb-3f6d35b868f1e4d8c4c0ea6f3fd42be487f5a448.tar.gz |
Revert "YT-20123: make proto config && check it on const values Bundle Controller API"
Revert "YT-20123: make proto config && check it on const values Bundle Controller API"
This reverts commit 8453c7bf41d12551c69cac13821f7832791ce2df, reversing
changes made to 45104909ab2b00afe2861dbb9e798f0b45e2a991.
-rw-r--r-- | yt/yt/client/api/bundle_controller_client.cpp | 20 | ||||
-rw-r--r-- | yt/yt/client/api/bundle_controller_client.h | 22 | ||||
-rw-r--r-- | yt/yt/client/api/delegating_client.cpp | 2 | ||||
-rw-r--r-- | yt/yt/client/api/delegating_client.h | 2 | ||||
-rw-r--r-- | yt/yt/client/api/rpc_proxy/client_impl.cpp | 2 | ||||
-rw-r--r-- | yt/yt/client/api/rpc_proxy/client_impl.h | 2 | ||||
-rw-r--r-- | yt/yt/client/driver/bundle_controller_commands.cpp | 7 | ||||
-rw-r--r-- | yt/yt/client/federated/client.cpp | 2 | ||||
-rw-r--r-- | yt/yt/client/hedging/hedging.cpp | 2 | ||||
-rw-r--r-- | yt/yt/client/unittests/mock/client.h | 2 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/CMakeLists.darwin-arm64.txt | 13 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/CMakeLists.darwin-x86_64.txt | 13 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/CMakeLists.linux-aarch64.txt | 13 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/CMakeLists.linux-x86_64.txt | 13 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/bundle_controller/proto/bundle_controller_service.proto | 52 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/ya.make | 2 |
16 files changed, 14 insertions, 155 deletions
diff --git a/yt/yt/client/api/bundle_controller_client.cpp b/yt/yt/client/api/bundle_controller_client.cpp index b22ff43d94..454cbe5b4d 100644 --- a/yt/yt/client/api/bundle_controller_client.cpp +++ b/yt/yt/client/api/bundle_controller_client.cpp @@ -4,26 +4,6 @@ namespace NYT::NApi { //////////////////////////////////////////////////////////////////////////////// -void TBundleConfigDescriptor::Register(TRegistrar registrar) -{ - registrar.Parameter("bundle_name", &TThis::BundleName) - .Default(); - - registrar.Parameter("cpu_limits", &TThis::CpuLimits) - .DefaultNew(); - registrar.Parameter("memory_limits", &TThis::MemoryLimits) - .DefaultNew(); - - registrar.Parameter("rpc_proxy_count", &TThis::RpcProxyCount) - .Default(0); - registrar.Parameter("rpc_proxy_resource_guarantee", &TThis::RpcProxyResourceGuarantee) - .DefaultNew(); - registrar.Parameter("tablet_node_count", &TThis::TabletNodeCount) - .Default(0); - registrar.Parameter("tablet_node_resource_guarantee", &TThis::TabletNodeResourceGuarantee) - .DefaultNew(); -} - //////////////////////////////////////////////////////////////////////////////// } // namespace NYT::NApi diff --git a/yt/yt/client/api/bundle_controller_client.h b/yt/yt/client/api/bundle_controller_client.h index 5b7eaa582d..7d61f93562 100644 --- a/yt/yt/client/api/bundle_controller_client.h +++ b/yt/yt/client/api/bundle_controller_client.h @@ -2,16 +2,10 @@ #include "client_common.h" -#include <yt/yt/ytlib/bundle_controller/bundle_controller_settings.h> - namespace NYT::NApi { //////////////////////////////////////////////////////////////////////////////// -DECLARE_REFCOUNTED_STRUCT(TBundleConfigDescriptor) - -//////////////////////////////////////////////////////////////////////////////// - struct TGetBundleConfigOptions : public TTimeoutOptions { }; @@ -19,33 +13,19 @@ struct TGetBundleConfigOptions //////////////////////////////////////////////////////////////////////////////// struct TBundleConfigDescriptor - : public NYTree::TYsonStruct { TString BundleName; - - NCellBalancer::TCpuLimitsPtr CpuLimits; - NCellBalancer::TMemoryLimitsPtr MemoryLimits; - int RpcProxyCount; - NCellBalancer::TInstanceResourcesPtr RpcProxyResourceGuarantee; - int TabletNodeCount; - NCellBalancer::TInstanceResourcesPtr TabletNodeResourceGuarantee; - - REGISTER_YSON_STRUCT(TBundleConfigDescriptor); - - static void Register(TRegistrar registrar); }; -DEFINE_REFCOUNTED_TYPE(TBundleConfigDescriptor) - //////////////////////////////////////////////////////////////////////////////// struct IBundleControllerClient { virtual ~IBundleControllerClient() = default; - virtual TFuture<TBundleConfigDescriptorPtr> GetBundleConfig( + virtual TFuture<TBundleConfigDescriptor> GetBundleConfig( const TString& bundleName, const TGetBundleConfigOptions& options = {}) = 0; }; diff --git a/yt/yt/client/api/delegating_client.cpp b/yt/yt/client/api/delegating_client.cpp index c878d878ad..75f4006502 100644 --- a/yt/yt/client/api/delegating_client.cpp +++ b/yt/yt/client/api/delegating_client.cpp @@ -1004,7 +1004,7 @@ TFuture<void> TDelegatingClient::AlterQuery( return Underlying_->AlterQuery(queryId, options); } -TFuture<TBundleConfigDescriptorPtr> TDelegatingClient::GetBundleConfig( +TFuture<TBundleConfigDescriptor> TDelegatingClient::GetBundleConfig( const TString& bundleName, const TGetBundleConfigOptions& options) { diff --git a/yt/yt/client/api/delegating_client.h b/yt/yt/client/api/delegating_client.h index 15abcbedec..07429b103f 100644 --- a/yt/yt/client/api/delegating_client.h +++ b/yt/yt/client/api/delegating_client.h @@ -618,7 +618,7 @@ public: NQueryTrackerClient::TQueryId queryId, const TAlterQueryOptions& options) override; - virtual TFuture<TBundleConfigDescriptorPtr> GetBundleConfig( + virtual TFuture<TBundleConfigDescriptor> GetBundleConfig( const TString& bundleName, const TGetBundleConfigOptions& options = {}) override; diff --git a/yt/yt/client/api/rpc_proxy/client_impl.cpp b/yt/yt/client/api/rpc_proxy/client_impl.cpp index 286b1785ef..aa76339c5f 100644 --- a/yt/yt/client/api/rpc_proxy/client_impl.cpp +++ b/yt/yt/client/api/rpc_proxy/client_impl.cpp @@ -2033,7 +2033,7 @@ TFuture<void> TClient::AlterQuery( ThrowUnimplemented("AlterQuery"); } -TFuture<TBundleConfigDescriptorPtr> TClient::GetBundleConfig( +TFuture<TBundleConfigDescriptor> TClient::GetBundleConfig( const TString& /*bundleName*/, const TGetBundleConfigOptions& /*options*/) { diff --git a/yt/yt/client/api/rpc_proxy/client_impl.h b/yt/yt/client/api/rpc_proxy/client_impl.h index 77c1b429f8..e6ab691e43 100644 --- a/yt/yt/client/api/rpc_proxy/client_impl.h +++ b/yt/yt/client/api/rpc_proxy/client_impl.h @@ -482,7 +482,7 @@ public: const TString& passwordSha256, const TListUserTokensOptions& options) override; - TFuture<TBundleConfigDescriptorPtr> GetBundleConfig( + TFuture<TBundleConfigDescriptor> GetBundleConfig( const TString& bundleName, const TGetBundleConfigOptions& options = {}) override; diff --git a/yt/yt/client/driver/bundle_controller_commands.cpp b/yt/yt/client/driver/bundle_controller_commands.cpp index b0f84ab542..d7591c8635 100644 --- a/yt/yt/client/driver/bundle_controller_commands.cpp +++ b/yt/yt/client/driver/bundle_controller_commands.cpp @@ -22,7 +22,12 @@ void TGetBundleConfigCommand::DoExecute(ICommandContextPtr context) Options)) .ValueOrThrow(); - context->ProduceOutputValue(ConvertToYsonString(result)); + context->ProduceOutputValue(BuildYsonStringFluently() + .BeginMap() + .Item("bundle_name").Value(result.BundleName) + .Item("rpc_proxy_count").Value(result.RpcProxyCount) + .Item("tablet_node_count").Value(result.TabletNodeCount) + .EndMap()); } //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/client/federated/client.cpp b/yt/yt/client/federated/client.cpp index f2606da4d6..98efe5b9a7 100644 --- a/yt/yt/client/federated/client.cpp +++ b/yt/yt/client/federated/client.cpp @@ -407,7 +407,7 @@ public: UNIMPLEMENTED_METHOD(TFuture<TQuery>, GetQuery, (NQueryTrackerClient::TQueryId, const TGetQueryOptions&)); UNIMPLEMENTED_METHOD(TFuture<TListQueriesResult>, ListQueries, (const TListQueriesOptions&)); UNIMPLEMENTED_METHOD(TFuture<void>, AlterQuery, (NQueryTrackerClient::TQueryId, const TAlterQueryOptions&)); - UNIMPLEMENTED_METHOD(TFuture<TBundleConfigDescriptorPtr>, GetBundleConfig, (const TString&, const TGetBundleConfigOptions&)); + UNIMPLEMENTED_METHOD(TFuture<TBundleConfigDescriptor>, GetBundleConfig, (const TString&, const TGetBundleConfigOptions&)); UNIMPLEMENTED_METHOD(TFuture<ITableReaderPtr>, CreateTableReader, (const NYPath::TRichYPath&, const TTableReaderOptions&)); UNIMPLEMENTED_METHOD(TFuture<ITableWriterPtr>, CreateTableWriter, (const NYPath::TRichYPath&, const TTableWriterOptions&)); diff --git a/yt/yt/client/hedging/hedging.cpp b/yt/yt/client/hedging/hedging.cpp index b76b740345..f27c17cc78 100644 --- a/yt/yt/client/hedging/hedging.cpp +++ b/yt/yt/client/hedging/hedging.cpp @@ -210,7 +210,7 @@ public: UNSUPPORTED_METHOD(TFuture<TQuery>, GetQuery, (NQueryTrackerClient::TQueryId, const TGetQueryOptions&)); UNSUPPORTED_METHOD(TFuture<TListQueriesResult>, ListQueries, (const TListQueriesOptions&)); UNSUPPORTED_METHOD(TFuture<void>, AlterQuery, (NQueryTrackerClient::TQueryId, const TAlterQueryOptions&)); - UNSUPPORTED_METHOD(TFuture<TBundleConfigDescriptorPtr>, GetBundleConfig, (const TString&, const TGetBundleConfigOptions&)); + UNSUPPORTED_METHOD(TFuture<TBundleConfigDescriptor>, GetBundleConfig, (const TString&, const TGetBundleConfigOptions&)); private: THedgingExecutorPtr Executor_; diff --git a/yt/yt/client/unittests/mock/client.h b/yt/yt/client/unittests/mock/client.h index 49c221d8ad..49dbe4c741 100644 --- a/yt/yt/client/unittests/mock/client.h +++ b/yt/yt/client/unittests/mock/client.h @@ -620,7 +620,7 @@ public: MOCK_METHOD(TFuture<void>, AlterQuery, ( NQueryTrackerClient::TQueryId queryId, const TAlterQueryOptions& options), (override)); - MOCK_METHOD(TFuture<TBundleConfigDescriptorPtr>, GetBundleConfig, ( + MOCK_METHOD(TFuture<TBundleConfigDescriptor>, GetBundleConfig, ( const TString& bundleName, const TGetBundleConfigOptions& options), (override)); }; diff --git a/yt/yt_proto/yt/client/CMakeLists.darwin-arm64.txt b/yt/yt_proto/yt/client/CMakeLists.darwin-arm64.txt index 6b09ba1a34..bde6ffe9e0 100644 --- a/yt/yt_proto/yt/client/CMakeLists.darwin-arm64.txt +++ b/yt/yt_proto/yt/client/CMakeLists.darwin-arm64.txt @@ -246,18 +246,6 @@ get_built_tool_path( contrib/tools/protoc/plugins/cpp_styleguide cpp_styleguide ) -get_built_tool_path( - TOOL_protoc_bin - TOOL_protoc_dependency - contrib/tools/protoc/bin - protoc -) -get_built_tool_path( - TOOL_cpp_styleguide_bin - TOOL_cpp_styleguide_dependency - contrib/tools/protoc/plugins/cpp_styleguide - cpp_styleguide -) add_library(yt_proto-yt-client) target_include_directories(yt_proto-yt-client PUBLIC @@ -272,7 +260,6 @@ target_link_libraries(yt_proto-yt-client PUBLIC target_proto_messages(yt_proto-yt-client PRIVATE ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/api/rpc_proxy/proto/discovery_service.proto - ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/bundle_controller/proto/bundle_controller_service.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/cell_master/proto/cell_directory.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/chaos_client/proto/replication_card.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/chunk_client/proto/data_statistics.proto diff --git a/yt/yt_proto/yt/client/CMakeLists.darwin-x86_64.txt b/yt/yt_proto/yt/client/CMakeLists.darwin-x86_64.txt index 6b09ba1a34..bde6ffe9e0 100644 --- a/yt/yt_proto/yt/client/CMakeLists.darwin-x86_64.txt +++ b/yt/yt_proto/yt/client/CMakeLists.darwin-x86_64.txt @@ -246,18 +246,6 @@ get_built_tool_path( contrib/tools/protoc/plugins/cpp_styleguide cpp_styleguide ) -get_built_tool_path( - TOOL_protoc_bin - TOOL_protoc_dependency - contrib/tools/protoc/bin - protoc -) -get_built_tool_path( - TOOL_cpp_styleguide_bin - TOOL_cpp_styleguide_dependency - contrib/tools/protoc/plugins/cpp_styleguide - cpp_styleguide -) add_library(yt_proto-yt-client) target_include_directories(yt_proto-yt-client PUBLIC @@ -272,7 +260,6 @@ target_link_libraries(yt_proto-yt-client PUBLIC target_proto_messages(yt_proto-yt-client PRIVATE ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/api/rpc_proxy/proto/discovery_service.proto - ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/bundle_controller/proto/bundle_controller_service.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/cell_master/proto/cell_directory.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/chaos_client/proto/replication_card.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/chunk_client/proto/data_statistics.proto diff --git a/yt/yt_proto/yt/client/CMakeLists.linux-aarch64.txt b/yt/yt_proto/yt/client/CMakeLists.linux-aarch64.txt index 9fa09c7646..b21f7290e7 100644 --- a/yt/yt_proto/yt/client/CMakeLists.linux-aarch64.txt +++ b/yt/yt_proto/yt/client/CMakeLists.linux-aarch64.txt @@ -246,18 +246,6 @@ get_built_tool_path( contrib/tools/protoc/plugins/cpp_styleguide cpp_styleguide ) -get_built_tool_path( - TOOL_protoc_bin - TOOL_protoc_dependency - contrib/tools/protoc/bin - protoc -) -get_built_tool_path( - TOOL_cpp_styleguide_bin - TOOL_cpp_styleguide_dependency - contrib/tools/protoc/plugins/cpp_styleguide - cpp_styleguide -) add_library(yt_proto-yt-client) target_include_directories(yt_proto-yt-client PUBLIC @@ -273,7 +261,6 @@ target_link_libraries(yt_proto-yt-client PUBLIC target_proto_messages(yt_proto-yt-client PRIVATE ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/api/rpc_proxy/proto/discovery_service.proto - ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/bundle_controller/proto/bundle_controller_service.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/cell_master/proto/cell_directory.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/chaos_client/proto/replication_card.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/chunk_client/proto/data_statistics.proto diff --git a/yt/yt_proto/yt/client/CMakeLists.linux-x86_64.txt b/yt/yt_proto/yt/client/CMakeLists.linux-x86_64.txt index 9fa09c7646..b21f7290e7 100644 --- a/yt/yt_proto/yt/client/CMakeLists.linux-x86_64.txt +++ b/yt/yt_proto/yt/client/CMakeLists.linux-x86_64.txt @@ -246,18 +246,6 @@ get_built_tool_path( contrib/tools/protoc/plugins/cpp_styleguide cpp_styleguide ) -get_built_tool_path( - TOOL_protoc_bin - TOOL_protoc_dependency - contrib/tools/protoc/bin - protoc -) -get_built_tool_path( - TOOL_cpp_styleguide_bin - TOOL_cpp_styleguide_dependency - contrib/tools/protoc/plugins/cpp_styleguide - cpp_styleguide -) add_library(yt_proto-yt-client) target_include_directories(yt_proto-yt-client PUBLIC @@ -273,7 +261,6 @@ target_link_libraries(yt_proto-yt-client PUBLIC target_proto_messages(yt_proto-yt-client PRIVATE ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/api/rpc_proxy/proto/discovery_service.proto - ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/bundle_controller/proto/bundle_controller_service.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/cell_master/proto/cell_directory.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/chaos_client/proto/replication_card.proto ${CMAKE_SOURCE_DIR}/yt/yt_proto/yt/client/chunk_client/proto/data_statistics.proto diff --git a/yt/yt_proto/yt/client/bundle_controller/proto/bundle_controller_service.proto b/yt/yt_proto/yt/client/bundle_controller/proto/bundle_controller_service.proto deleted file mode 100644 index 4629d1e559..0000000000 --- a/yt/yt_proto/yt/client/bundle_controller/proto/bundle_controller_service.proto +++ /dev/null @@ -1,52 +0,0 @@ -package NYT.NBundleController.NProto; - -//////////////////////////////////////////////////////////////////////////////// - -message TCpuLimits -{ - optional int32 lookup_thread_pool_size = 1; - optional int32 query_thread_pool_size = 2; - optional int32 write_thread_pool_size = 3; -} - -message TMemoryLimits -{ - optional int64 compressed_block_cache = 1; - optional int64 key_filter_block_cache = 2; - optional int64 lookup_row_cache = 3; - - optional int64 tablet_dynamic = 4; - optional int64 tablet_static = 5; - - optional int64 uncompressed_block_cache = 6; - optional int64 versioned_chunk_meta = 7; -} - -message TInstanceResources -{ - optional int64 memory = 1; - optional int64 net = 2; - optional string type = 3; - optional int32 vcpu = 4; -} - -message TReqGetBundleConfig -{ - required string bundle_name = 1; -} - -message TRspGetBundleConfig -{ - optional string bundle_name = 1; - - optional TCpuLimits cpu_limits = 2; - optional TMemoryLimits memory_limits = 3; - - optional int32 rpc_proxy_count = 4; - optional TInstanceResources rpc_proxy_resource_guarantee = 5; - - optional int32 tablet_node_count = 6; - optional TInstanceResources tablet_node_resource_guarantee = 7; -} - -//////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt_proto/yt/client/ya.make b/yt/yt_proto/yt/client/ya.make index 8c742acce8..0ac05be114 100644 --- a/yt/yt_proto/yt/client/ya.make +++ b/yt/yt_proto/yt/client/ya.make @@ -14,8 +14,6 @@ SRCS( api/rpc_proxy/proto/api_service.proto api/rpc_proxy/proto/discovery_service.proto - bundle_controller/proto/bundle_controller_service.proto - cell_master/proto/cell_directory.proto chaos_client/proto/replication_card.proto |