diff options
author | msherbakov <msherbakov@yandex-team.ru> | 2022-02-10 16:49:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:17 +0300 |
commit | a0ffafe83b7d6229709a32fa942c71d672ac989c (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/monlib/encode/buffered/string_pool.h | |
parent | c224a621661ddd69699f9476922eb316607ef57e (diff) | |
download | ydb-a0ffafe83b7d6229709a32fa942c71d672ac989c.tar.gz |
Restoring authorship annotation for <msherbakov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/monlib/encode/buffered/string_pool.h')
-rw-r--r-- | library/cpp/monlib/encode/buffered/string_pool.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/library/cpp/monlib/encode/buffered/string_pool.h b/library/cpp/monlib/encode/buffered/string_pool.h index 39fab1673f..00e5644608 100644 --- a/library/cpp/monlib/encode/buffered/string_pool.h +++ b/library/cpp/monlib/encode/buffered/string_pool.h @@ -9,13 +9,13 @@ namespace NMonitoring { //////////////////////////////////////////////////////////////////////////////// class TStringPoolBuilder { public: - struct TValue: TNonCopyable { - TValue(ui32 idx, ui32 freq) - : Index{idx} - , Frequency{freq} - { - } - + struct TValue: TNonCopyable { + TValue(ui32 idx, ui32 freq) + : Index{idx} + , Frequency{freq} + { + } + ui32 Index; ui32 Frequency; }; @@ -24,16 +24,16 @@ namespace NMonitoring { const TValue* PutIfAbsent(TStringBuf str); const TValue* GetByIndex(ui32 index) const; - /// Determines whether pool must be sorted by value frequencies - TStringPoolBuilder& SetSorted(bool sorted) { - RequiresSorting_ = sorted; - return *this; - } + /// Determines whether pool must be sorted by value frequencies + TStringPoolBuilder& SetSorted(bool sorted) { + RequiresSorting_ = sorted; + return *this; + } + + TStringPoolBuilder& Build(); - TStringPoolBuilder& Build(); - TStringBuf Get(ui32 index) const { - Y_ENSURE(IsBuilt_, "Pool must be sorted first"); + Y_ENSURE(IsBuilt_, "Pool must be sorted first"); return StrVector_.at(index).first; } @@ -43,7 +43,7 @@ namespace NMonitoring { template <typename TConsumer> void ForEach(TConsumer&& c) { - Y_ENSURE(IsBuilt_, "Pool must be sorted first"); + Y_ENSURE(IsBuilt_, "Pool must be sorted first"); for (const auto& value : StrVector_) { c(value.first, value.second->Index, value.second->Frequency); } @@ -60,8 +60,8 @@ namespace NMonitoring { private: THashMap<TString, TValue> StrMap_; TVector<std::pair<TStringBuf, TValue*>> StrVector_; - bool RequiresSorting_ = false; - bool IsBuilt_ = false; + bool RequiresSorting_ = false; + bool IsBuilt_ = false; size_t BytesSize_ = 0; }; |