Skip to content

Commit 6bc0348

Browse files
author
babenko
committed
YT-25593: Replace TString with std::string for addresses, hostnames etc
e10316e900a0dd13e98e68dacd3338f5d277c8a2
1 parent 8e9d441 commit 6bc0348

File tree

99 files changed

+487
-484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+487
-484
lines changed

yt/yt/client/api/admin_client.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ struct IAdminClient
227227

228228
virtual TFuture<void> SwitchLeader(
229229
NHydra::TCellId cellId,
230-
const TString& newLeaderAddress,
230+
const std::string& newLeaderAddress,
231231
const TSwitchLeaderOptions& options = {}) = 0;
232232

233233
virtual TFuture<void> ResetStateHash(
@@ -238,23 +238,23 @@ struct IAdminClient
238238
const TGCCollectOptions& options = {}) = 0;
239239

240240
virtual TFuture<void> KillProcess(
241-
const TString& address,
241+
const std::string& address,
242242
const TKillProcessOptions& options = {}) = 0;
243243

244244
virtual TFuture<TString> WriteCoreDump(
245-
const TString& address,
245+
const std::string& address,
246246
const TWriteCoreDumpOptions& options = {}) = 0;
247247

248248
virtual TFuture<TGuid> WriteLogBarrier(
249-
const TString& address,
249+
const std::string& address,
250250
const TWriteLogBarrierOptions& options) = 0;
251251

252252
virtual TFuture<TString> WriteOperationControllerCoreDump(
253253
NJobTrackerClient::TOperationId operationId,
254254
const TWriteOperationControllerCoreDumpOptions& options = {}) = 0;
255255

256256
virtual TFuture<void> HealExecNode(
257-
const TString& address,
257+
const std::string& address,
258258
const THealExecNodeOptions& options = {}) = 0;
259259

260260
virtual TFuture<void> SuspendCoordinator(
@@ -287,35 +287,35 @@ struct IAdminClient
287287

288288
virtual TFuture<TMaintenanceIdPerTarget> AddMaintenance(
289289
EMaintenanceComponent component,
290-
const TString& address,
290+
const std::string& address,
291291
EMaintenanceType type,
292292
const TString& comment,
293293
const TAddMaintenanceOptions& options = {}) = 0;
294294

295295
virtual TFuture<TMaintenanceCountsPerTarget> RemoveMaintenance(
296296
EMaintenanceComponent component,
297-
const TString& address,
297+
const std::string& address,
298298
const TMaintenanceFilter& filter,
299299
const TRemoveMaintenanceOptions& options = {}) = 0;
300300

301301
virtual TFuture<TDisableChunkLocationsResult> DisableChunkLocations(
302-
const TString& nodeAddress,
302+
const std::string& nodeAddress,
303303
const std::vector<TGuid>& locationUuids,
304304
const TDisableChunkLocationsOptions& options = {}) = 0;
305305

306306
virtual TFuture<TDestroyChunkLocationsResult> DestroyChunkLocations(
307-
const TString& nodeAddress,
307+
const std::string& nodeAddress,
308308
bool recoverUnlinkedDisks,
309309
const std::vector<TGuid>& locationUuids,
310310
const TDestroyChunkLocationsOptions& options = {}) = 0;
311311

312312
virtual TFuture<TResurrectChunkLocationsResult> ResurrectChunkLocations(
313-
const TString& nodeAddress,
313+
const std::string& nodeAddress,
314314
const std::vector<TGuid>& locationUuids,
315315
const TResurrectChunkLocationsOptions& options = {}) = 0;
316316

317317
virtual TFuture<TRequestRestartResult> RequestRestart(
318-
const TString& nodeAddress,
318+
const std::string& nodeAddress,
319319
const TRequestRestartOptions& options = {}) = 0;
320320
};
321321

yt/yt/client/api/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class TConnectionConfig
5050
{
5151
public:
5252
EConnectionType ConnectionType;
53-
std::optional<TString> ClusterName;
53+
std::optional<std::string> ClusterName;
5454
TTableMountCacheConfigPtr TableMountCache;
5555
NChaosClient::TReplicationCardCacheConfigPtr ReplicationCardCache;
5656

yt/yt/client/api/connection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct IConnection
4848
virtual TClusterTag GetClusterTag() const = 0;
4949
virtual const TString& GetLoggingTag() const = 0;
5050
virtual const TString& GetClusterId() const = 0;
51-
virtual const std::optional<TString>& GetClusterName() const = 0;
51+
virtual const std::optional<std::string>& GetClusterName() const = 0;
5252
virtual IInvokerPtr GetInvoker() = 0;
5353

5454
// TODO(gritukan): Fix alien transaction creation for RPC proxy connection

yt/yt/client/api/delegating_client.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ class TDelegatingClient
599599

600600
DELEGATE_METHOD(TFuture<void>, SwitchLeader, (
601601
NHydra::TCellId cellId,
602-
const TString& newLeaderAddress,
602+
const std::string& newLeaderAddress,
603603
const TSwitchLeaderOptions& options),
604604
(cellId, newLeaderAddress, options))
605605

@@ -613,17 +613,17 @@ class TDelegatingClient
613613
(options))
614614

615615
DELEGATE_METHOD(TFuture<void>, KillProcess, (
616-
const TString& address,
616+
const std::string& address,
617617
const TKillProcessOptions& options),
618618
(address, options))
619619

620620
DELEGATE_METHOD(TFuture<TString>, WriteCoreDump, (
621-
const TString& address,
621+
const std::string& address,
622622
const TWriteCoreDumpOptions& options),
623623
(address, options))
624624

625625
DELEGATE_METHOD(TFuture<TGuid>, WriteLogBarrier, (
626-
const TString& address,
626+
const std::string& address,
627627
const TWriteLogBarrierOptions& options),
628628
(address, options))
629629

@@ -633,7 +633,7 @@ class TDelegatingClient
633633
(operationId, options))
634634

635635
DELEGATE_METHOD(TFuture<void>, HealExecNode, (
636-
const TString& address,
636+
const std::string& address,
637637
const THealExecNodeOptions& options),
638638
(address, options))
639639

@@ -674,40 +674,40 @@ class TDelegatingClient
674674

675675
DELEGATE_METHOD(TFuture<TMaintenanceIdPerTarget>, AddMaintenance, (
676676
EMaintenanceComponent component,
677-
const TString& address,
677+
const std::string& address,
678678
EMaintenanceType type,
679679
const TString& comment,
680680
const TAddMaintenanceOptions& options),
681681
(component, address, type, comment, options))
682682

683683
DELEGATE_METHOD(TFuture<TMaintenanceCountsPerTarget>, RemoveMaintenance, (
684684
EMaintenanceComponent component,
685-
const TString& address,
685+
const std::string& address,
686686
const TMaintenanceFilter& filter,
687687
const TRemoveMaintenanceOptions& options),
688688
(component, address, filter, options))
689689

690690
DELEGATE_METHOD(TFuture<TDisableChunkLocationsResult>, DisableChunkLocations, (
691-
const TString& nodeAddress,
691+
const std::string& nodeAddress,
692692
const std::vector<TGuid>& locationUuids,
693693
const TDisableChunkLocationsOptions& options),
694694
(nodeAddress, locationUuids, options))
695695

696696
DELEGATE_METHOD(TFuture<TDestroyChunkLocationsResult>, DestroyChunkLocations, (
697-
const TString& nodeAddress,
697+
const std::string& nodeAddress,
698698
bool recoverUnlinkedDisks,
699699
const std::vector<TGuid>& locationUuids,
700700
const TDestroyChunkLocationsOptions& options),
701701
(nodeAddress, recoverUnlinkedDisks, locationUuids, options))
702702

703703
DELEGATE_METHOD(TFuture<TResurrectChunkLocationsResult>, ResurrectChunkLocations, (
704-
const TString& nodeAddress,
704+
const std::string& nodeAddress,
705705
const std::vector<TGuid>& locationUuids,
706706
const TResurrectChunkLocationsOptions& options),
707707
(nodeAddress, locationUuids, options))
708708

709709
DELEGATE_METHOD(TFuture<TRequestRestartResult>, RequestRestart, (
710-
const TString& nodeAddress,
710+
const std::string& nodeAddress,
711711
const TRequestRestartOptions& options),
712712
(nodeAddress, options))
713713

yt/yt/client/api/etc_client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ struct TClusterMeta
3232
std::shared_ptr<NHiveClient::NProto::TClusterDirectory> ClusterDirectory;
3333
std::shared_ptr<NChunkClient::NProto::TMediumDirectory> MediumDirectory;
3434
std::shared_ptr<NObjectClient::NProto::TUserDirectory> UserDirectory;
35-
std::vector<TString> MasterCacheNodeAddresses;
36-
std::vector<TString> TimestampProviderAddresses;
35+
std::vector<std::string> MasterCacheNodeAddresses;
36+
std::vector<std::string> TimestampProviderAddresses;
3737
NYTree::IMapNodePtr Features;
3838
};
3939

yt/yt/client/api/public.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ using TMaintenanceCounts = TEnumIndexedArray<EMaintenanceType, int>;
226226
// "host" target which represents all nodes on a given host.
227227
constexpr int TypicalMaintenanceTargetCount = 1;
228228

229-
using TMaintenanceIdPerTarget = TCompactFlatMap<TString, TMaintenanceId, TypicalMaintenanceTargetCount>;
230-
using TMaintenanceCountsPerTarget = TCompactFlatMap<TString, TMaintenanceCounts, TypicalMaintenanceTargetCount>;
229+
using TMaintenanceIdPerTarget = TCompactFlatMap<std::string, TMaintenanceId, TypicalMaintenanceTargetCount>;
230+
using TMaintenanceCountsPerTarget = TCompactFlatMap<std::string, TMaintenanceCounts, TypicalMaintenanceTargetCount>;
231231

232232
////////////////////////////////////////////////////////////////////////////////
233233

yt/yt/client/api/rpc_proxy/address_helpers.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ using namespace NNet;
1010
////////////////////////////////////////////////////////////////////////////////
1111

1212
const EAddressType DefaultAddressType(EAddressType::InternalRpc);
13-
const TString DefaultNetworkName("default");
13+
const std::string DefaultNetworkName("default");
1414

1515
////////////////////////////////////////////////////////////////////////////////
1616

@@ -31,10 +31,10 @@ TAddressMap GetLocalAddresses(const NNodeTrackerClient::TNetworkAddressList& add
3131

3232
////////////////////////////////////////////////////////////////////////////////
3333

34-
std::optional<TString> GetAddressOrNull(
34+
std::optional<std::string> GetAddressOrNull(
3535
const TProxyAddressMap& addresses,
3636
EAddressType type,
37-
const TString& network)
37+
const std::string& network)
3838
{
3939
auto typeAddressesIt = addresses.find(type);
4040
if (typeAddressesIt != addresses.end()) {
@@ -48,11 +48,11 @@ std::optional<TString> GetAddressOrNull(
4848

4949
////////////////////////////////////////////////////////////////////////////////
5050

51-
std::optional<std::vector<TString>> GetBalancersOrNull(
51+
std::optional<std::vector<std::string>> GetBalancersOrNull(
5252
const TBalancersMap& balancers,
53-
const TString& role,
53+
const std::string& role,
5454
EAddressType addressType,
55-
const TString& network)
55+
const std::string& network)
5656
{
5757
auto roleBalancersIt = balancers.find(role);
5858
if (roleBalancersIt != balancers.end()) {

yt/yt/client/api/rpc_proxy/address_helpers.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ namespace NYT::NApi::NRpcProxy {
99
////////////////////////////////////////////////////////////////////////////////
1010

1111
// Network -> host:port.
12-
using TAddressMap = THashMap<TString, TString>;
12+
using TAddressMap = THashMap<std::string, std::string>;
1313

1414
// Address type (e.g. RPC, HTTP) -> network -> host:port.
1515
using TProxyAddressMap = THashMap<EAddressType, TAddressMap>;
1616

1717
extern const EAddressType DefaultAddressType;
18-
extern const TString DefaultNetworkName;
18+
extern const std::string DefaultNetworkName;
1919

2020
// Network -> [host:port].
21-
using TNetworkAddressesMap = THashMap<TString, std::vector<TString>>;
21+
using TNetworkAddressesMap = THashMap<std::string, std::vector<std::string>>;
2222

2323
// Address type (e.g. RPC, HTTP) -> network -> [host:port].
2424
using TAddressTypeAddressesMap = THashMap<EAddressType, TNetworkAddressesMap>;
2525

2626
// Role -> address type -> network -> host:port.
27-
using TBalancersMap = THashMap<TString, TAddressTypeAddressesMap>;
27+
using TBalancersMap = THashMap<std::string, TAddressTypeAddressesMap>;
2828

2929
////////////////////////////////////////////////////////////////////////////////
3030

@@ -34,18 +34,18 @@ TAddressMap GetLocalAddresses(
3434

3535
////////////////////////////////////////////////////////////////////////////////
3636

37-
std::optional<TString> GetAddressOrNull(
37+
std::optional<std::string> GetAddressOrNull(
3838
const TProxyAddressMap& addresses,
3939
EAddressType addressType,
40-
const TString& network);
40+
const std::string& network);
4141

4242
////////////////////////////////////////////////////////////////////////////////
4343

44-
std::optional<std::vector<TString>> GetBalancersOrNull(
44+
std::optional<std::vector<std::string>> GetBalancersOrNull(
4545
const TBalancersMap& balancers,
46-
const TString& role,
46+
const std::string& role,
4747
EAddressType addressType,
48-
const TString& network);
48+
const std::string& network);
4949

5050
////////////////////////////////////////////////////////////////////////////////
5151

0 commit comments

Comments
 (0)