-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We added Column Sketches as an optional, we can use: cmake .. -DCOMPILE_COLUMNSKETCHES=ON to turn on building Column Sketches Note that Column Sketches is a private repo, and by default the option is turned off.
- Loading branch information
1 parent
ba43e8c
commit 4281f2c
Showing
5 changed files
with
103 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#ifndef BLISS_BENCH_COLUMNSKETCHES | ||
#define BLISS_BENCH_COLUMNSKETCHES | ||
#ifdef COMPILE_COLUMNSKETCHES | ||
#include <vector> | ||
|
||
#include "bliss/bliss_index.h" | ||
#include "column_sketches.h" | ||
|
||
namespace bliss { | ||
|
||
template <typename KEY_TYPE, typename VALUE_TYPE> | ||
class BlissColumnSketchesIndex : public BlissIndex<KEY_TYPE, VALUE_TYPE> { | ||
public: | ||
BlissColumnSketchesIndex() { | ||
columnsketches_ = new ColumnSketchesInteger(); | ||
}; | ||
|
||
~BlissColumnSketchesIndex() { | ||
delete columnsketches_; | ||
} | ||
|
||
void bulkload( | ||
std::vector<std::pair<KEY_TYPE, VALUE_TYPE>> values) override { | ||
std::vector<int32_t> vals; | ||
for(auto x: values) { | ||
vals.push_back(x.second); | ||
} | ||
columnsketches_->create(&vals[0], vals.size(), vals.size()); | ||
} | ||
|
||
bool get(VALUE_TYPE start, VALUE_TYPE end) { | ||
uint32_t *res = columnsketches_->query_ge_lt(start, end); | ||
bool succeed = res != nullptr; | ||
if(succeed) delete res; | ||
return succeed; | ||
} | ||
|
||
bool get(KEY_TYPE key) override { | ||
std::runtime_error("Column Imprints does not support get(key, value)."); | ||
return false; | ||
} | ||
|
||
void put(KEY_TYPE key, VALUE_TYPE value) { | ||
std::runtime_error("Column Imprints does not support put(key, value)."); | ||
return; | ||
} | ||
|
||
void end_routine() override {} | ||
private: | ||
|
||
ColumnSketchesInteger *columnsketches_; | ||
}; | ||
|
||
} // namespace bliss | ||
#endif | ||
#endif // !BLISS_BENCH_BTREE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,4 @@ class BlissIndex { | |
|
||
} // namespace bliss | ||
|
||
#endif // !BLISS_INDEX | ||
#endif // !BLISS_INDEX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters