@@ -14,28 +14,51 @@ class TStorageConfigClient::TImpl : public TClientImplCommon<TStorageConfigClien
14
14
{
15
15
}
16
16
17
- TAsyncStatus ReplaceStorageConfig (const std::string& config) {
17
+ TAsyncStatus ReplaceStorageConfig (const std::optional<TString>& yaml_config,
18
+ const std::optional<TString>& storage_yaml_config,
19
+ std::optional<bool > switch_dedicated_storage_section,
20
+ bool dedicated_config_mode) {
18
21
auto request = MakeRequest<Ydb::BSConfig::ReplaceStorageConfigRequest>();
19
- request.set_yaml_config (config);
22
+
23
+ if (yaml_config) {
24
+ request.set_yaml_config (*yaml_config);
25
+ }
26
+ if (storage_yaml_config) {
27
+ request.set_storage_yaml_config (*storage_yaml_config);
28
+ }
29
+ if (switch_dedicated_storage_section) {
30
+ request.set_switch_dedicated_storage_section (*switch_dedicated_storage_section);
31
+ }
32
+ request.set_dedicated_config_mode (dedicated_config_mode);
20
33
21
34
return RunSimple<Ydb::BSConfig::V1::BSConfigService, Ydb::BSConfig::ReplaceStorageConfigRequest, Ydb::BSConfig::ReplaceStorageConfigResponse>(
22
35
std::move (request),
23
36
&Ydb::BSConfig::V1::BSConfigService::Stub::AsyncReplaceStorageConfig);
24
37
}
25
38
26
- TAsyncFetchStorageConfigResult FetchStorageConfig (const TStorageConfigSettings& settings = {}) {
39
+ TAsyncFetchStorageConfigResult FetchStorageConfig (bool dedicated_storage_section, bool dedicated_cluster_section,
40
+ const TStorageConfigSettings& settings = {}) {
27
41
auto request = MakeOperationRequest<Ydb::BSConfig::FetchStorageConfigRequest>(settings);
42
+ if (dedicated_storage_section) {
43
+ request.set_dedicated_storage_section (true );
44
+ }
45
+ if (dedicated_cluster_section) {
46
+ request.set_dedicated_cluster_section (true );
47
+ }
28
48
auto promise = NThreading::NewPromise<TFetchStorageConfigResult>();
29
49
30
50
auto extractor = [promise] (google::protobuf::Any* any, TPlainStatus status) mutable {
31
- NYdb::TStringType config;
32
- if (Ydb::BSConfig::FetchStorageConfigResult result; any && any->UnpackTo (&result)) {
33
- config = result.yaml_config ();
34
- }
35
-
36
- TFetchStorageConfigResult val (TStatus (std::move (status)), std::string{std::move (config)});
37
- promise.SetValue (std::move (val));
38
- };
51
+ NYdb::TStringType config;
52
+ NYdb::TStringType storage_config;
53
+ if (Ydb::BSConfig::FetchStorageConfigResult result; any && any->UnpackTo (&result)) {
54
+ config = result.yaml_config ();
55
+ storage_config = result.storage_yaml_config ();
56
+ }
57
+
58
+ TFetchStorageConfigResult val (TStatus (std::move (status)), std::string{std::move (config)},
59
+ std::string{std::move (storage_config)});
60
+ promise.SetValue (std::move (val));
61
+ };
39
62
40
63
Connections_->RunDeferred <Ydb::BSConfig::V1::BSConfigService, Ydb::BSConfig::FetchStorageConfigRequest, Ydb::BSConfig::FetchStorageConfigResponse>(
41
64
std::move (request),
@@ -62,12 +85,16 @@ TStorageConfigClient::TStorageConfigClient(const TDriver& driver, const TCommonC
62
85
63
86
TStorageConfigClient::~TStorageConfigClient () = default ;
64
87
65
- TAsyncStatus TStorageConfigClient::ReplaceStorageConfig (const std::string& config) {
66
- return Impl_->ReplaceStorageConfig (config);
88
+ TAsyncStatus TStorageConfigClient::ReplaceStorageConfig (const std::optional<TString>& yaml_config,
89
+ const std::optional<TString>& storage_yaml_config, std::optional<bool > switch_dedicated_storage_section,
90
+ bool dedicated_config_mode) {
91
+ return Impl_->ReplaceStorageConfig (yaml_config, storage_yaml_config, switch_dedicated_storage_section,
92
+ dedicated_config_mode);
67
93
}
68
94
69
- TAsyncFetchStorageConfigResult TStorageConfigClient::FetchStorageConfig (const TStorageConfigSettings& settings) {
70
- return Impl_->FetchStorageConfig (settings);
95
+ TAsyncFetchStorageConfigResult TStorageConfigClient::FetchStorageConfig (bool dedicated_storage_section,
96
+ bool dedicated_cluster_section, const TStorageConfigSettings& settings) {
97
+ return Impl_->FetchStorageConfig (dedicated_storage_section, dedicated_cluster_section, settings);
71
98
}
72
99
73
100
TAsyncStatus TStorageConfigClient::BootstrapCluster (const std::string& selfAssemblyUUID) {
0 commit comments