aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/containers/comptrie/comptrie_builder.h
diff options
context:
space:
mode:
authorsereglond <sereglond@yandex-team.ru>2022-02-10 16:47:46 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:46 +0300
commiteb3d925534734c808602b31b38b953677f0a279f (patch)
tree4222ef8dc375ee9f30b68a004ee42a0845e005b6 /library/cpp/containers/comptrie/comptrie_builder.h
parent4c8065245df3ea26b7757bcb1f8218df287f9148 (diff)
downloadydb-eb3d925534734c808602b31b38b953677f0a279f.tar.gz
Restoring authorship annotation for <sereglond@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/containers/comptrie/comptrie_builder.h')
-rw-r--r--library/cpp/containers/comptrie/comptrie_builder.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/containers/comptrie/comptrie_builder.h b/library/cpp/containers/comptrie/comptrie_builder.h
index cf7d2e39a3..e8e55302ce 100644
--- a/library/cpp/containers/comptrie/comptrie_builder.h
+++ b/library/cpp/containers/comptrie/comptrie_builder.h
@@ -6,12 +6,12 @@
#include <util/stream/file.h>
-// --------------------------------------------------------------------------------------
-// Data Builder
-// To build the data buffer, we first create an automaton in memory. The automaton
+// --------------------------------------------------------------------------------------
+// Data Builder
+// To build the data buffer, we first create an automaton in memory. The automaton
// is created incrementally. It actually helps a lot to have the input data prefix-grouped
-// by key; otherwise, memory consumption becomes a tough issue.
-// NOTE: building and serializing the automaton may be lengthy, and takes lots of memory.
+// by key; otherwise, memory consumption becomes a tough issue.
+// NOTE: building and serializing the automaton may be lengthy, and takes lots of memory.
// PREFIX_GROUPED means that if we, while constructing a trie, add to the builder two keys with the same prefix,
// then all the keys that we add between these two also have the same prefix.
@@ -38,11 +38,11 @@ template <typename T>
class TArrayWithSizeHolder;
template <class T = char, class D = ui64, class S = TCompactTriePacker<D>>
-class TCompactTrieBuilder {
-public:
- typedef T TSymbol;
- typedef D TData;
- typedef S TPacker;
+class TCompactTrieBuilder {
+public:
+ typedef T TSymbol;
+ typedef D TData;
+ typedef S TPacker;
typedef typename TCompactTrieKeySelector<TSymbol>::TKey TKey;
typedef typename TCompactTrieKeySelector<TSymbol>::TKeyBuf TKeyBuf;
@@ -71,7 +71,7 @@ public:
return AddSubtreeInBuffer(key.data(), key.size(), std::move(buffer));
}
- bool Find(const TSymbol* key, size_t keylen, TData* value) const;
+ bool Find(const TSymbol* key, size_t keylen, TData* value) const;
bool Find(const TKeyBuf& key, TData* value = nullptr) const {
return Find(key.data(), key.size(), value);
}
@@ -90,8 +90,8 @@ public:
void Clear(); // Returns all memory to the system and resets the builder state.
- size_t GetEntryCount() const;
- size_t GetNodeCount() const;
+ size_t GetEntryCount() const;
+ size_t GetNodeCount() const;
// Exact output file size in bytes.
size_t MeasureByteSize() const {
@@ -99,8 +99,8 @@ public:
}
protected:
- class TCompactTrieBuilderImpl;
- THolder<TCompactTrieBuilderImpl> Impl;
+ class TCompactTrieBuilderImpl;
+ THolder<TCompactTrieBuilderImpl> Impl;
};
//----------------------------------------------------------------------------------------------------------------------
@@ -117,7 +117,7 @@ protected:
// as you expect it to, and can destroy the trie in the making.
// If you want both minimization and fast layout, do the minimization first.
-template <class TPacker>
+template <class TPacker>
size_t CompactTrieMinimize(IOutputStream& os, const char* data, size_t datalength, bool verbose = false, const TPacker& packer = TPacker(), NCompactTrie::EMinimizeMode mode = NCompactTrie::MM_DEFAULT);
template <class TTrieBuilder>