diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2023-06-13 13:56:28 -0400 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2023-06-13 13:56:28 -0400 |
| commit | fc1a33a205d8ded47c933fe2d2c4a0a9b454a4d3 (patch) | |
| tree | 13222e6e24ba4023ffbefca1eee02ccf2a181e0d /include/shard/TrieSpline.h | |
| parent | 37304a11b8edfef8fc627e7a3a095e77e70b07b1 (diff) | |
| download | dynamic-extension-fc1a33a205d8ded47c933fe2d2c4a0a9b454a4d3.tar.gz | |
TrieSpline: parameterized TrieSpline template with max error
Diffstat (limited to 'include/shard/TrieSpline.h')
| -rw-r--r-- | include/shard/TrieSpline.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/include/shard/TrieSpline.h b/include/shard/TrieSpline.h index 1588507..432614c 100644 --- a/include/shard/TrieSpline.h +++ b/include/shard/TrieSpline.h @@ -27,8 +27,6 @@ namespace de { -size_t g_max_error = 1024; - template <RecordInterface R> struct ts_range_query_parms { decltype(R::key) lower_bound; @@ -55,7 +53,7 @@ struct TrieSplineBufferState { }; -template <RecordInterface R> +template <RecordInterface R, size_t E=1024> class TrieSpline { private: typedef decltype(R::key) K; @@ -85,7 +83,7 @@ public: K min_key = base->rec.key; K max_key = (stop - 1)->rec.key; - auto bldr = ts::Builder<K>(min_key, max_key, g_max_error); + auto bldr = ts::Builder<K>(min_key, max_key, E); while (base < stop) { if (!(base->is_tombstone()) && (base + 1) < stop) { @@ -159,7 +157,7 @@ public: } m_bf = new BloomFilter<R>(BF_FPR, tombstone_count, BF_HASH_FUNCS); - auto bldr = ts::Builder<K>(m_min_key, m_max_key, g_max_error); + auto bldr = ts::Builder<K>(m_min_key, m_max_key, E); size_t alloc_size = (attemp_reccnt * sizeof(Wrapped<R>)) + (CACHELINE_SIZE - (attemp_reccnt * sizeof(Wrapped<R>)) % CACHELINE_SIZE); assert(alloc_size % CACHELINE_SIZE == 0); |