diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2024-01-31 20:57:40 -0500 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2024-01-31 20:57:40 -0500 |
| commit | 080e73dd1f90163cea987ba3d3d56e3c1b7ddea7 (patch) | |
| tree | 270afad74239301adcab127b535f180085f426cd /benchmarks/include/data-proc.h | |
| parent | f7f61d6d5367f2984cbf40c3cd6d85f75cd999af (diff) | |
| download | dynamic-extension-080e73dd1f90163cea987ba3d3d56e3c1b7ddea7.tar.gz | |
Updated throughput bench to use SOSD
Diffstat (limited to 'benchmarks/include/data-proc.h')
| -rw-r--r-- | benchmarks/include/data-proc.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/benchmarks/include/data-proc.h b/benchmarks/include/data-proc.h index f758ed4..dbac671 100644 --- a/benchmarks/include/data-proc.h +++ b/benchmarks/include/data-proc.h @@ -10,6 +10,8 @@ #include "psu-ds/BTree.h" +#pragma once + typedef uint64_t key_type; typedef uint64_t value_type; typedef uint64_t weight_type; @@ -242,3 +244,15 @@ static bool build_delete_vec(std::vector<R> &to_delete, std::vector<R> &vec, siz td: return true; } + +static std::vector<int64_t> read_sosd_file(std::string &fname, size_t n) { + std::fstream file; + file.open(fname, std::ios::in | std::ios::binary); + + std::vector<int64_t> records(n); + for (size_t i=0; i<n; i++) { + file.read((char*) &(records[i]), sizeof(int64_t)); + } + + return records; +} |