aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/encode/buffered/string_pool.h
diff options
context:
space:
mode:
authormsherbakov <msherbakov@yandex-team.ru>2022-02-10 16:49:16 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:16 +0300
commitc224a621661ddd69699f9476922eb316607ef57e (patch)
tree33f4d878aa0a9faa964005e06bfab0272313aa71 /library/cpp/monlib/encode/buffered/string_pool.h
parent29d0b2eeae154d04156e0698067c0c21a97ea61d (diff)
downloadydb-c224a621661ddd69699f9476922eb316607ef57e.tar.gz
Restoring authorship annotation for <msherbakov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/monlib/encode/buffered/string_pool.h')
-rw-r--r--library/cpp/monlib/encode/buffered/string_pool.h36
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 00e5644608..39fab1673f 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;
- }
-
- TStringPoolBuilder& Build();
+ /// Determines whether pool must be sorted by value frequencies
+ TStringPoolBuilder& SetSorted(bool sorted) {
+ RequiresSorting_ = sorted;
+ return *this;
+ }
+ 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;
};