diff options
author | Alexander Smirnov <alex@ydb.tech> | 2025-02-23 00:51:45 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2025-02-23 00:51:45 +0000 |
commit | 92c53fa8f6f68034c47921d71d94608d769790c7 (patch) | |
tree | 9699426f0696e3cd63542c7ffb8ca1db7213406b /yt | |
parent | 68803c1896c016d643b7b5b8d45b2bc5bb829942 (diff) | |
parent | 33fd3a38939d03482d5cc81b8db3e0e3e866b66c (diff) | |
download | ydb-92c53fa8f6f68034c47921d71d94608d769790c7.tar.gz |
Merge branch 'rightlib' into merge-libs-250223-0050
Diffstat (limited to 'yt')
-rw-r--r-- | yt/yql/providers/yt/comp_nodes/dq/dq_yt_block_reader.cpp | 2 | ||||
-rw-r--r-- | yt/yt/client/api/operation_client.h | 8 | ||||
-rw-r--r-- | yt/yt/client/object_client/helpers.cpp | 6 | ||||
-rw-r--r-- | yt/yt/client/object_client/helpers.h | 2 | ||||
-rw-r--r-- | yt/yt/client/security_client/acl.cpp | 2 | ||||
-rw-r--r-- | yt/yt/client/security_client/acl.h | 6 | ||||
-rw-r--r-- | yt/yt/client/security_client/helpers.cpp | 8 | ||||
-rw-r--r-- | yt/yt/client/security_client/helpers.h | 6 | ||||
-rw-r--r-- | yt/yt/client/ypath/rich.cpp | 3 | ||||
-rw-r--r-- | yt/yt/core/logging/config.h | 8 | ||||
-rw-r--r-- | yt/yt/core/logging/log_manager.cpp | 8 | ||||
-rw-r--r-- | yt/yt/core/misc/configurable_singleton_def-inl.h | 3 | ||||
-rw-r--r-- | yt/yt/core/rpc/service_detail.cpp | 5 | ||||
-rw-r--r-- | yt/yt/core/rpc/service_detail.h | 4 | ||||
-rw-r--r-- | yt/yt/core/ytree/attributes.cpp | 6 | ||||
-rw-r--r-- | yt/yt/core/ytree/yson_struct-inl.h | 3 |
16 files changed, 39 insertions, 41 deletions
diff --git a/yt/yql/providers/yt/comp_nodes/dq/dq_yt_block_reader.cpp b/yt/yql/providers/yt/comp_nodes/dq/dq_yt_block_reader.cpp index 46273d69c1..df4a15fe46 100644 --- a/yt/yql/providers/yt/comp_nodes/dq/dq_yt_block_reader.cpp +++ b/yt/yql/providers/yt/comp_nodes/dq/dq_yt_block_reader.cpp @@ -428,7 +428,7 @@ public: if (!res.IsOK()) { // Propagate error - Listener_->HandleError(res.GetMessage()); + Listener_->HandleError(TString(res.GetMessage())); return; } diff --git a/yt/yt/client/api/operation_client.h b/yt/yt/client/api/operation_client.h index df0f3411e1..9a2ccfc976 100644 --- a/yt/yt/client/api/operation_client.h +++ b/yt/yt/client/api/operation_client.h @@ -114,11 +114,11 @@ struct TGetJobFailContextOptions struct TListOperationsAccessFilter : public NYTree::TYsonStruct { - TString Subject; + std::string Subject; NYTree::EPermissionSet Permissions; // This parameter cannot be set from YSON, it must be computed. - THashSet<TString> SubjectTransitiveClosure; + THashSet<std::string> SubjectTransitiveClosure; REGISTER_YSON_STRUCT(TListOperationsAccessFilter); @@ -303,7 +303,7 @@ struct TOperation std::optional<TInstant> StartTime; std::optional<TInstant> FinishTime; - std::optional<TString> AuthenticatedUser; + std::optional<std::string> AuthenticatedUser; NYson::TYsonString BriefSpec; NYson::TYsonString Spec; @@ -319,7 +319,7 @@ struct TOperation NYson::TYsonString RuntimeParameters; std::optional<bool> Suspended; - std::optional<TString> SuspendReason; + std::optional<std::string> SuspendReason; NYson::TYsonString Events; NYson::TYsonString Result; diff --git a/yt/yt/client/object_client/helpers.cpp b/yt/yt/client/object_client/helpers.cpp index 6dbea8270c..0fbc5a8c9b 100644 --- a/yt/yt/client/object_client/helpers.cpp +++ b/yt/yt/client/object_client/helpers.cpp @@ -332,9 +332,11 @@ bool IsSchemaType(EObjectType type) return (static_cast<ui32>(type) & SchemaObjectTypeMask) != 0; } -TString FormatObjectType(EObjectType type) +std::string FormatObjectType(EObjectType type) { - return IsSchemaType(type) ? Format("schema:%v", TypeFromSchemaType(type)) : FormatEnum(type); + return IsSchemaType(type) + ? std::string(Format("schema:%v", TypeFromSchemaType(type))) + : FormatEnum(type); } bool IsGlobalCellId(TCellId cellId) diff --git a/yt/yt/client/object_client/helpers.h b/yt/yt/client/object_client/helpers.h index 8ff3066b25..6a4f49c30c 100644 --- a/yt/yt/client/object_client/helpers.h +++ b/yt/yt/client/object_client/helpers.h @@ -125,7 +125,7 @@ EObjectType SchemaTypeFromType(EObjectType type); EObjectType TypeFromSchemaType(EObjectType type); //! Formats object type into string (taking schemas into account). -TString FormatObjectType(EObjectType type); +std::string FormatObjectType(EObjectType type); //! Constructs the id from its parts. TObjectId MakeId( diff --git a/yt/yt/client/security_client/acl.cpp b/yt/yt/client/security_client/acl.cpp index 25f4db0c33..efe43529ed 100644 --- a/yt/yt/client/security_client/acl.cpp +++ b/yt/yt/client/security_client/acl.cpp @@ -16,7 +16,7 @@ TSerializableAccessControlEntry::TSerializableAccessControlEntry() = default; TSerializableAccessControlEntry::TSerializableAccessControlEntry( ESecurityAction action, - std::vector<TString> subjects, + std::vector<std::string> subjects, EPermissionSet permissions, EAceInheritanceMode inheritanceMode) : Action(action) diff --git a/yt/yt/client/security_client/acl.h b/yt/yt/client/security_client/acl.h index 28f2edd762..24ade027b8 100644 --- a/yt/yt/client/security_client/acl.h +++ b/yt/yt/client/security_client/acl.h @@ -17,16 +17,16 @@ namespace NYT::NSecurityClient { struct TSerializableAccessControlEntry { ESecurityAction Action = ESecurityAction::Undefined; - std::vector<TString> Subjects; + std::vector<std::string> Subjects; NYTree::EPermissionSet Permissions; EAceInheritanceMode InheritanceMode = EAceInheritanceMode::ObjectAndDescendants; - TString SubjectTagFilter; + std::optional<std::string> SubjectTagFilter; std::optional<std::vector<std::string>> Columns; std::optional<bool> Vital; TSerializableAccessControlEntry( ESecurityAction action, - std::vector<TString> subjects, + std::vector<std::string> subjects, NYTree::EPermissionSet permissions, EAceInheritanceMode inheritanceMode = EAceInheritanceMode::ObjectAndDescendants); diff --git a/yt/yt/client/security_client/helpers.cpp b/yt/yt/client/security_client/helpers.cpp index 88df829c05..c08fb9c9be 100644 --- a/yt/yt/client/security_client/helpers.cpp +++ b/yt/yt/client/security_client/helpers.cpp @@ -15,12 +15,12 @@ TYPath GetUserPath(const std::string& name) return "//sys/users/" + ToYPathLiteral(name); } -TYPath GetGroupPath(const TString& name) +TYPath GetGroupPath(const std::string& name) { return "//sys/groups/" + ToYPathLiteral(name); } -TYPath GetAccountPath(const TString& name) +TYPath GetAccountPath(const std::string& name) { return "//sys/accounts/" + ToYPathLiteral(name); } @@ -29,7 +29,7 @@ TYPath GetAccountPath(const TString& name) ESecurityAction CheckPermissionsByAclAndSubjectClosure( const TSerializableAccessControlList& acl, - const THashSet<TString>& subjectClosure, + const THashSet<std::string>& subjectClosure, NYTree::EPermissionSet permissions) { NYTree::EPermissionSet allowedPermissions = {}; @@ -37,7 +37,7 @@ ESecurityAction CheckPermissionsByAclAndSubjectClosure( for (const auto& ace : acl.Entries) { if (ace.Action != NSecurityClient::ESecurityAction::Allow && ace.Action != NSecurityClient::ESecurityAction::Deny) { - THROW_ERROR_EXCEPTION("Action %Qv is not supported", FormatEnum(ace.Action)); + THROW_ERROR_EXCEPTION("Action %Qlv is not supported", ace.Action); } for (const auto& aceSubject : ace.Subjects) { if (subjectClosure.contains(aceSubject)) { diff --git a/yt/yt/client/security_client/helpers.h b/yt/yt/client/security_client/helpers.h index 650b1341d9..6c72590cac 100644 --- a/yt/yt/client/security_client/helpers.h +++ b/yt/yt/client/security_client/helpers.h @@ -12,14 +12,14 @@ namespace NYT::NSecurityClient { //////////////////////////////////////////////////////////////////////////////// NYPath::TYPath GetUserPath(const std::string& name); -NYPath::TYPath GetGroupPath(const TString& name); -NYPath::TYPath GetAccountPath(const TString& name); +NYPath::TYPath GetGroupPath(const std::string& name); +NYPath::TYPath GetAccountPath(const std::string& name); //////////////////////////////////////////////////////////////////////////////// ESecurityAction CheckPermissionsByAclAndSubjectClosure( const TSerializableAccessControlList& acl, - const THashSet<TString>& subjectClosure, + const THashSet<std::string>& subjectClosure, NYTree::EPermissionSet permissions); void ValidateSecurityTag(const TSecurityTag& tag); diff --git a/yt/yt/client/ypath/rich.cpp b/yt/yt/client/ypath/rich.cpp index 6a4bd12a2a..60e853ac2c 100644 --- a/yt/yt/client/ypath/rich.cpp +++ b/yt/yt/client/ypath/rich.cpp @@ -662,8 +662,7 @@ std::optional<std::string> TRichYPath::GetCluster() const void TRichYPath::SetCluster(const std::string& value) { - // TODO(babenko): switch to std::string - Attributes().Set("cluster", TString(value)); + Attributes().Set("cluster", value); } std::optional<std::vector<TString>> TRichYPath::GetClusters() const diff --git a/yt/yt/core/logging/config.h b/yt/yt/core/logging/config.h index 60f02ad45d..f634e3af4f 100644 --- a/yt/yt/core/logging/config.h +++ b/yt/yt/core/logging/config.h @@ -166,9 +166,9 @@ public: THashMap<TString, i64> CategoryRateLimits; //! Messages with these prefixes will not be logged regardless of the configured levels. - std::vector<TString> SuppressedMessages; + std::vector<std::string> SuppressedMessages; //! Overrides levels of messages with a matching prefix . - THashMap<TString, ELogLevel> MessageLevelOverrides; + THashMap<std::string, ELogLevel> MessageLevelOverrides; TDuration RequestSuppressionTimeout; @@ -224,8 +224,8 @@ public: std::optional<std::vector<TRuleConfigPtr>> Rules; std::optional<THashMap<TString, i64>> CategoryRateLimits; - std::optional<std::vector<TString>> SuppressedMessages; - THashMap<TString, ELogLevel> MessageLevelOverrides; + std::optional<std::vector<std::string>> SuppressedMessages; + THashMap<std::string, ELogLevel> MessageLevelOverrides; std::optional<TDuration> RequestSuppressionTimeout; diff --git a/yt/yt/core/logging/log_manager.cpp b/yt/yt/core/logging/log_manager.cpp index dce60bf222..d257351f25 100644 --- a/yt/yt/core/logging/log_manager.cpp +++ b/yt/yt/core/logging/log_manager.cpp @@ -1377,18 +1377,18 @@ private: { YT_ASSERT_SPINLOCK_AFFINITY(SpinLock_); - auto isPrefixOf = [] (const TString& message, const std::vector<TString>& prefixes) { + auto isPrefixOf = [] (const std::string& message, const std::vector<std::string>& prefixes) { for (const auto& prefix : prefixes) { - if (message.StartsWith(prefix)) { + if (message.starts_with(prefix)) { return true; } } return false; }; - auto findByPrefix = [] (const TString& message, const THashMap<TString, ELogLevel>& levelOverrides) -> std::optional<ELogLevel> { + auto findByPrefix = [] (const std::string& message, const THashMap<std::string, ELogLevel>& levelOverrides) -> std::optional<ELogLevel> { for (const auto& [prefix, level] : levelOverrides) { - if (message.StartsWith(prefix)) { + if (message.starts_with(prefix)) { return level; } } diff --git a/yt/yt/core/misc/configurable_singleton_def-inl.h b/yt/yt/core/misc/configurable_singleton_def-inl.h index cb9dbc76f1..79945d9da2 100644 --- a/yt/yt/core/misc/configurable_singleton_def-inl.h +++ b/yt/yt/core/misc/configurable_singleton_def-inl.h @@ -64,8 +64,7 @@ struct TSingletonConfigHelpers return [=] (NYTree::TYsonStructRegistrar<TManagerConfig> registrar) { SetupSingletonConfigParameter( registrar.template ParameterWithUniversalAccessor<TIntrusivePtr<TSingletonConfig>>( - // TODO(babenko): switch to std::string - TString(singletonName), + singletonName, [=] (TManagerConfig* config) -> auto& { auto it = config->NameToConfig_.find(singletonName); if (it == config->NameToConfig_.end()) { diff --git a/yt/yt/core/rpc/service_detail.cpp b/yt/yt/core/rpc/service_detail.cpp index 0943c54744..c374da2d7a 100644 --- a/yt/yt/core/rpc/service_detail.cpp +++ b/yt/yt/core/rpc/service_detail.cpp @@ -324,7 +324,9 @@ TServiceBase::TPerformanceCounters::TPerformanceCounters(const NProfiling::TProf NProfiling::TCounter* TServiceBase::TPerformanceCounters::GetRequestsPerUserAgentCounter(TStringBuf userAgent) { return RequestsPerUserAgent_.FindOrInsert(userAgent, [&] { - return Profiler_.WithRequiredTag("user_agent", TString(userAgent)).Counter("/user_agent"); + return Profiler_ + .WithRequiredTag("user_agent", std::string(userAgent)) + .Counter("/user_agent"); }).first; } @@ -2318,7 +2320,6 @@ TServiceBase::TMethodPerformanceCountersPtr TServiceBase::CreateMethodPerformanc auto profiler = runtimeInfo->Profiler.WithSparse(); if (userTag) { - // TODO(babenko): migrate to std::string profiler = profiler.WithTag("user", std::string(userTag)); } if (runtimeInfo->Descriptor.RequestQueueProvider) { diff --git a/yt/yt/core/rpc/service_detail.h b/yt/yt/core/rpc/service_detail.h index f7f937246c..0f6a1323c3 100644 --- a/yt/yt/core/rpc/service_detail.h +++ b/yt/yt/core/rpc/service_detail.h @@ -766,7 +766,7 @@ protected: std::atomic<TDuration> LoggingSuppressionTimeout = {}; using TNonowningPerformanceCountersKey = std::tuple<TStringBuf, TRequestQueue*>; - using TOwningPerformanceCountersKey = std::tuple<TString, TRequestQueue*>; + using TOwningPerformanceCountersKey = std::tuple<std::string, TRequestQueue*>; using TPerformanceCountersKeyHash = THash<TNonowningPerformanceCountersKey>; struct TPerformanceCountersKeyEquals @@ -813,7 +813,7 @@ protected: const NProfiling::TProfiler Profiler_; //! Number of requests per user agent. - NConcurrency::TSyncMap<TString, NProfiling::TCounter> RequestsPerUserAgent_; + NConcurrency::TSyncMap<std::string, NProfiling::TCounter, THash<TStringBuf>, TEqualTo<TStringBuf>> RequestsPerUserAgent_; }; using TPerformanceCountersPtr = TIntrusivePtr<TPerformanceCounters>; diff --git a/yt/yt/core/ytree/attributes.cpp b/yt/yt/core/ytree/attributes.cpp index 96f69f33c8..6d20ee6379 100644 --- a/yt/yt/core/ytree/attributes.cpp +++ b/yt/yt/core/ytree/attributes.cpp @@ -28,8 +28,7 @@ TYsonString IAttributeDictionary::GetYsonAndRemove(TKeyView key) void IAttributeDictionary::MergeFrom(const IMapNodePtr& other) { for (const auto& [key, value] : other->GetChildren()) { - // TODO(babenko): migrate to std::string - SetYson(TString(key), ConvertToYsonString(value)); + SetYson(key, ConvertToYsonString(value)); } } @@ -64,8 +63,7 @@ IAttributeDictionaryPtr IAttributeDictionary::FromMap(const IMapNodePtr& node) auto attributes = CreateEphemeralAttributes(); auto children = node->GetChildren(); for (int index = 0; index < std::ssize(children); ++index) { - // TODO(babenko): migrate to std::string - attributes->SetYson(TString(children[index].first), ConvertToYsonString(children[index].second)); + attributes->SetYson(children[index].first, ConvertToYsonString(children[index].second)); } return attributes; } diff --git a/yt/yt/core/ytree/yson_struct-inl.h b/yt/yt/core/ytree/yson_struct-inl.h index ab5b695dce..9ef10db1b5 100644 --- a/yt/yt/core/ytree/yson_struct-inl.h +++ b/yt/yt/core/ytree/yson_struct-inl.h @@ -337,8 +337,7 @@ THashMap<TKey, TIntrusivePtr<TValue>> CloneYsonStructs(const THashMap<TKey, TInt THashMap<TKey, TIntrusivePtr<TValue>> clonedObjs; clonedObjs.reserve(objs.size()); for (const auto& [key, obj] : objs) { - // TODO(babenko): switch to std::string - clonedObjs.emplace(std::string(key), CloneYsonStruct(obj)); + clonedObjs.emplace(key, CloneYsonStruct(obj)); } return clonedObjs; } |