Skip to content

Commit fe92253

Browse files
author
babenko
committed
YT-22593: Switch to std::string for endpoint description
e17521ea2be2d1728e2ac9fbd71b93c95bce5ccd
1 parent f521542 commit fe92253

32 files changed

+65
-65
lines changed

yt/yt/client/api/rpc_proxy/connection_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class TProxyChannelProvider
164164
, EndpointAttributes_(MakeEndpointAttributes(config, connectionId))
165165
{ }
166166

167-
const TString& GetEndpointDescription() const override
167+
const std::string& GetEndpointDescription() const override
168168
{
169169
return EndpointDescription_;
170170
}
@@ -205,7 +205,7 @@ class TProxyChannelProvider
205205
const bool Sticky_;
206206
const TGuid ConnectionId_;
207207

208-
const TString EndpointDescription_;
208+
const std::string EndpointDescription_;
209209
const IAttributeDictionaryPtr EndpointAttributes_;
210210

211211
YT_DECLARE_SPIN_LOCK(NThreading::TSpinLock, SpinLock_);

yt/yt/client/transaction_client/remote_timestamp_provider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ IChannelPtr CreateTimestampProviderChannel(
3838
auto channel = CreateBalancingChannel(
3939
config,
4040
std::move(channelFactory),
41-
std::move(endpointDescription),
41+
endpointDescription,
4242
std::move(endpointAttributes));
4343
channel = CreateRetryingChannel(
4444
config,

yt/yt/core/bus/bus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct IBus
7070
{
7171
//! Returns a textual representation of the bus' endpoint.
7272
//! Typically used for logging.
73-
virtual const TString& GetEndpointDescription() const = 0;
73+
virtual const std::string& GetEndpointDescription() const = 0;
7474

7575
//! Returns the bus' endpoint attributes.
7676
//! Typically used for constructing errors.

yt/yt/core/bus/client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct IBusClient
2222
{
2323
//! Returns a textual representation of the bus' endpoint.
2424
//! Typically used for logging.
25-
virtual const TString& GetEndpointDescription() const = 0;
25+
virtual const std::string& GetEndpointDescription() const = 0;
2626

2727
//! Returns the bus' endpoint attributes.
2828
//! Typically used for constructing errors.

yt/yt/core/bus/tcp/client.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class TTcpClientBusProxy
5151
Connection_->Terminate(TError(NBus::EErrorCode::TransportError, "Bus terminated"));
5252
}
5353

54-
const TString& GetEndpointDescription() const override
54+
const std::string& GetEndpointDescription() const override
5555
{
5656
VERIFY_THREAD_AFFINITY_ANY();
5757
return Connection_->GetEndpointDescription();
@@ -161,7 +161,7 @@ class TTcpBusClient
161161
.EndMap());
162162
}
163163

164-
const TString& GetEndpointDescription() const override
164+
const std::string& GetEndpointDescription() const override
165165
{
166166
return EndpointDescription_;
167167
}
@@ -220,7 +220,7 @@ class TTcpBusClient
220220

221221
const IMemoryUsageTrackerPtr MemoryUsageTracker_;
222222

223-
TString EndpointDescription_;
223+
std::string EndpointDescription_;
224224
IAttributeDictionaryPtr EndpointAttributes_;
225225
};
226226

yt/yt/core/bus/tcp/connection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ TTcpConnection::TTcpConnection(
106106
TConnectionId id,
107107
SOCKET socket,
108108
EMultiplexingBand multiplexingBand,
109-
const TString& endpointDescription,
109+
const std::string& endpointDescription,
110110
const IAttributeDictionary& endpointAttributes,
111111
const TNetworkAddress& endpointNetworkAddress,
112112
const std::optional<std::string>& endpointAddress,
@@ -654,7 +654,7 @@ void TTcpConnection::OnDialerFinished(const TErrorOr<SOCKET>& socketOrError)
654654
}
655655
}
656656

657-
const TString& TTcpConnection::GetEndpointDescription() const
657+
const std::string& TTcpConnection::GetEndpointDescription() const
658658
{
659659
return EndpointDescription_;
660660
}

yt/yt/core/bus/tcp/connection.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class TTcpConnection
8080
TConnectionId id,
8181
SOCKET socket,
8282
EMultiplexingBand multiplexingBand,
83-
const TString& endpointDescription,
83+
const std::string& endpointDescription,
8484
const NYTree::IAttributeDictionary& endpointAttributes,
8585
const NNet::TNetworkAddress& endpointNetworkAddress,
8686
const std::optional<std::string>& endpointAddress,
@@ -104,7 +104,7 @@ class TTcpConnection
104104
void OnShutdown() override;
105105

106106
// IBus implementation.
107-
const TString& GetEndpointDescription() const override;
107+
const std::string& GetEndpointDescription() const override;
108108
const NYTree::IAttributeDictionary& GetEndpointAttributes() const override;
109109
const std::string& GetEndpointAddress() const override;
110110
const NNet::TNetworkAddress& GetEndpointNetworkAddress() const override;
@@ -187,7 +187,7 @@ class TTcpConnection
187187
const TBusConfigPtr Config_;
188188
const EConnectionType ConnectionType_;
189189
const TConnectionId Id_;
190-
const TString EndpointDescription_;
190+
const std::string EndpointDescription_;
191191
const NYTree::IAttributeDictionaryPtr EndpointAttributes_;
192192
const NNet::TNetworkAddress EndpointNetworkAddress_;
193193
const std::optional<TString> EndpointAddress_;

yt/yt/core/rpc/balancing_channel.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class TBalancingChannelSubprovider
4242
TBalancingChannelSubprovider(
4343
TBalancingChannelConfigPtr config,
4444
IChannelFactoryPtr channelFactory,
45-
TString endpointDescription,
45+
const std::string& endpointDescription,
4646
IAttributeDictionaryPtr endpointAttributes,
4747
std::string serviceName,
4848
IPeerDiscoveryPtr peerDiscovery)
@@ -96,7 +96,7 @@ class TBalancingChannelSubprovider
9696

9797
private:
9898
const TBalancingChannelConfigPtr Config_;
99-
const TString EndpointDescription_;
99+
const std::string EndpointDescription_;
100100
const IAttributeDictionaryPtr EndpointAttributes_;
101101
const TString ServiceName_;
102102

@@ -176,7 +176,7 @@ class TBalancingChannelProvider
176176
TBalancingChannelProvider(
177177
TBalancingChannelConfigPtr config,
178178
IChannelFactoryPtr channelFactory,
179-
TString endpointDescription,
179+
const std::string& endpointDescription,
180180
IAttributeDictionaryPtr endpointAttributes,
181181
IPeerDiscoveryPtr peerDiscovery)
182182
: Config_(std::move(config))
@@ -192,7 +192,7 @@ class TBalancingChannelProvider
192192
, PeerDiscovery_(std::move(peerDiscovery))
193193
{ }
194194

195-
const TString& GetEndpointDescription() const override
195+
const std::string& GetEndpointDescription() const override
196196
{
197197
return EndpointDescription_;
198198
}
@@ -243,7 +243,7 @@ class TBalancingChannelProvider
243243
const TBalancingChannelConfigPtr Config_;
244244
const IChannelFactoryPtr ChannelFactory_;
245245

246-
const TString EndpointDescription_;
246+
const std::string EndpointDescription_;
247247
const IAttributeDictionaryPtr EndpointAttributes_;
248248
const IPeerDiscoveryPtr PeerDiscovery_;
249249

@@ -288,14 +288,14 @@ DEFINE_REFCOUNTED_TYPE(TBalancingChannelProvider)
288288
IChannelPtr CreateBalancingChannel(
289289
TBalancingChannelConfigPtr config,
290290
IChannelFactoryPtr channelFactory,
291-
TString endpointDescription,
291+
const std::string& endpointDescription,
292292
IAttributeDictionaryPtr endpointAttributes,
293293
IPeerDiscoveryPtr peerDiscovery)
294294
{
295295
auto channelProvider = CreateBalancingChannelProvider(
296296
std::move(config),
297297
std::move(channelFactory),
298-
std::move(endpointDescription),
298+
endpointDescription,
299299
std::move(endpointAttributes),
300300
std::move(peerDiscovery));
301301

@@ -305,7 +305,7 @@ IChannelPtr CreateBalancingChannel(
305305
IRoamingChannelProviderPtr CreateBalancingChannelProvider(
306306
TBalancingChannelConfigPtr config,
307307
IChannelFactoryPtr channelFactory,
308-
TString endpointDescription,
308+
const std::string& endpointDescription,
309309
IAttributeDictionaryPtr endpointAttributes,
310310
IPeerDiscoveryPtr peerDiscovery)
311311
{
@@ -316,7 +316,7 @@ IRoamingChannelProviderPtr CreateBalancingChannelProvider(
316316
return New<TBalancingChannelProvider>(
317317
std::move(config),
318318
std::move(channelFactory),
319-
std::move(endpointDescription),
319+
endpointDescription,
320320
std::move(endpointAttributes),
321321
std::move(peerDiscovery));
322322
}

yt/yt/core/rpc/balancing_channel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ namespace NYT::NRpc {
1616
IChannelPtr CreateBalancingChannel(
1717
TBalancingChannelConfigPtr config,
1818
IChannelFactoryPtr channelFactory,
19-
TString endpointDescription,
19+
const std::string& endpointDescription,
2020
NYTree::IAttributeDictionaryPtr endpointAttributes,
2121
IPeerDiscoveryPtr peerDiscovery = CreateDefaultPeerDiscovery());
2222

2323
IRoamingChannelProviderPtr CreateBalancingChannelProvider(
2424
TBalancingChannelConfigPtr config,
2525
IChannelFactoryPtr channelFactory,
26-
TString endpointDescription,
26+
const std::string& endpointDescription,
2727
NYTree::IAttributeDictionaryPtr endpointAttributes,
2828
IPeerDiscoveryPtr peerDiscovery = CreateDefaultPeerDiscovery());
2929

yt/yt/core/rpc/bus/channel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class TBusChannel
6464
YT_VERIFY(MemoryUsageTracker_);
6565
}
6666

67-
const TString& GetEndpointDescription() const override
67+
const std::string& GetEndpointDescription() const override
6868
{
6969
return Client_->GetEndpointDescription();
7070
}

0 commit comments

Comments
 (0)