Skip to content

Commit 58c6940

Browse files
alexvrugithub-actions[bot]
authored andcommitted
Move bridge pile name to node location for convenience (#21176)
1 parent e8ac479 commit 58c6940

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

.github/last_commit.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
824ceef81947f283a068e13cc46703c70abe0cba
1+
e25fa623e2266542c13aaf00e98d295768297be8

include/ydb-cpp-sdk/client/discovery/discovery.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ struct TNodeLocation {
3333
std::optional<uint32_t> BodyNum;
3434
std::optional<uint32_t> Body;
3535

36+
std::optional<std::string> BridgePileName;
3637
std::optional<std::string> DataCenter;
3738
std::optional<std::string> Module;
3839
std::optional<std::string> Rack;
@@ -48,7 +49,6 @@ struct TNodeRegistrationSettings : public TSimpleRequestSettings<TNodeRegistrati
4849
FLUENT_SETTING(std::string, DomainPath);
4950
FLUENT_SETTING_DEFAULT(bool, FixedNodeId, false);
5051
FLUENT_SETTING(std::string, Path);
51-
FLUENT_SETTING(std::string, BridgePileName);
5252
};
5353

5454
struct TEndpointInfo {
@@ -97,7 +97,6 @@ struct TNodeInfo {
9797
std::string Address;
9898
TNodeLocation Location;
9999
uint64_t Expire;
100-
std::optional<uint32_t> BridgePileId;
101100
};
102101

103102
class TNodeRegistrationResult : public TStatus {

src/api/protos/ydb_discovery.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ message NodeLocation {
6969
optional uint32 body_num = 4 [deprecated=true];
7070
optional uint32 body = 100500 [deprecated=true]; // for compatibility with WalleLocation
7171

72+
optional string bridge_pile_name = 5;
7273
optional string data_center = 10;
7374
optional string module = 20;
7475
optional string rack = 30;
@@ -83,7 +84,6 @@ message NodeInfo {
8384
optional string address = 5;
8485
optional NodeLocation location = 6;
8586
optional uint64 expire = 7;
86-
optional uint32 bridge_pile_id = 8;
8787
}
8888

8989
message NodeRegistrationRequest {
@@ -95,7 +95,6 @@ message NodeRegistrationRequest {
9595
optional string domain_path = 6;
9696
optional bool fixed_node_id = 7;
9797
optional string path = 8;
98-
optional string bridge_pile_name = 9;
9998
}
10099

101100
message NodeRegistrationResult {

src/client/discovery/discovery.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ TNodeLocation::TNodeLocation(const Ydb::Discovery::NodeLocation& location)
6363
, RackNum(location.has_rack_num() ? std::make_optional(location.rack_num()) : std::nullopt)
6464
, BodyNum(location.has_body_num() ? std::make_optional(location.body_num()) : std::nullopt)
6565
, Body(location.has_body() ? std::make_optional(location.body()) : std::nullopt)
66+
, BridgePileName(location.has_bridge_pile_name() ? std::make_optional(location.bridge_pile_name()) : std::nullopt)
6667
, DataCenter(location.has_data_center() ? std::make_optional(location.data_center()) : std::nullopt)
6768
, Module(location.has_module() ? std::make_optional(location.module()) : std::nullopt)
6869
, Rack(location.has_rack() ? std::make_optional(location.rack()) : std::nullopt)
6970
, Unit(location.has_unit() ? std::make_optional(location.unit()) : std::nullopt)
70-
{}
71+
{}
7172

7273
TNodeInfo::TNodeInfo(const Ydb::Discovery::NodeInfo& info)
7374
: NodeId(info.node_id())
@@ -77,7 +78,6 @@ TNodeInfo::TNodeInfo(const Ydb::Discovery::NodeInfo& info)
7778
, Address(info.address())
7879
, Location(info.location())
7980
, Expire(info.expire())
80-
, BridgePileId(info.has_bridge_pile_id() ? std::make_optional(info.bridge_pile_id()) : std::nullopt)
8181
{}
8282

8383
TNodeRegistrationResult::TNodeRegistrationResult(TStatus&& status, const Ydb::Discovery::NodeRegistrationResult& proto)
@@ -209,13 +209,13 @@ class TDiscoveryClient::TImpl : public TClientImplCommon<TDiscoveryClient::TImpl
209209
if (!settings.Path_.empty()) {
210210
request.set_path(TStringType{settings.Path_});
211211
}
212-
if (!settings.BridgePileName_.empty()) {
213-
request.set_bridge_pile_name(TStringType{settings.BridgePileName_});
214-
}
215212

216213
auto requestLocation = request.mutable_location();
217214
const auto& location = settings.Location_;
218215

216+
if (location.BridgePileName) {
217+
requestLocation->set_bridge_pile_name(TStringType{location.BridgePileName.value()});
218+
}
219219
if (location.DataCenter) {
220220
requestLocation->set_data_center(TStringType{location.DataCenter.value()});
221221
}

0 commit comments

Comments
 (0)