summaryrefslogtreecommitdiffstats
path: root/library/cpp/actors/util
diff options
context:
space:
mode:
authorivanmorozov <[email protected]>2023-04-11 20:13:07 +0300
committerivanmorozov <[email protected]>2023-04-11 20:13:07 +0300
commitfc0abe8a74268234d67d4046b4177a7ef061da3a (patch)
treebb71fbad961dbfdb3316171dd83e4b72699ee229 /library/cpp/actors/util
parent952712c0ec8005e7ed4290dfdd1a345514b7564a (diff)
use 200 chars solomon-tag-limit
Diffstat (limited to 'library/cpp/actors/util')
-rw-r--r--library/cpp/actors/util/local_process_key.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/library/cpp/actors/util/local_process_key.h b/library/cpp/actors/util/local_process_key.h
index b82db5cfe5f..4d000db1980 100644
--- a/library/cpp/actors/util/local_process_key.h
+++ b/library/cpp/actors/util/local_process_key.h
@@ -12,7 +12,7 @@ class TLocalProcessKeyState {
template <typename U, const char* Name>
friend class TLocalProcessKey;
-template <typename U, class TClass>
+template <typename U, class TClass, ui32 KeyLengthLimit>
friend class TLocalProcessExtKey;
template <typename U, typename EnumT>
friend class TEnumProcessKey;
@@ -92,7 +92,7 @@ private:
inline static size_t Index = TLocalProcessKeyState<T>::GetInstance().Register(Name);
};
-template <typename T, class TClass>
+template <typename T, class TClass, ui32 KeyLengthLimit = 0>
class TLocalProcessExtKey {
public:
static TStringBuf GetName() {
@@ -104,8 +104,18 @@ public:
}
private:
+
+ static TString TypeNameRobust() {
+ const TString className = TypeName<TClass>();
+ if (KeyLengthLimit && className.size() > KeyLengthLimit) {
+ return className.substr(0, KeyLengthLimit - 3) + "...";
+ } else {
+ return className;
+ }
+ }
+
static const inline TString Name = TypeName<TClass>();
- inline static size_t Index = TLocalProcessKeyState<T>::GetInstance().Register(TypeName<TClass>());
+ inline static size_t Index = TLocalProcessKeyState<T>::GetInstance().Register(TypeNameRobust());
};
template <typename T, typename EnumT>