From 9fe305c7d28e993e55c55427f377ae7e3251ea4f Mon Sep 17 00:00:00 2001 From: "Douglas B. Rumbaugh" Date: Fri, 6 Dec 2024 13:13:51 -0500 Subject: Interface update (#5) * Query Interface Adjustments/Refactoring Began the process of adjusting the query interface (and also the shard interface, to a lesser degree) to better accommodate the user. In particular the following changes have been made, 1. The number of necessary template arguments for the query type has been drastically reduced, while also removing the void pointers and manual delete functions from the interface. This was accomplished by requiring many of the sub-types associated with a query (parameters, etc.) to be nested inside the main query class, and by forcing the SHARD type to expose its associated record type. 2. User-defined query return types are now supported. Queries no longer are required to return strictly sets of records. Instead, the query now has LocalResultType and ResultType template parameters (which can be defaulted using a typedef in the Query type itself), allowing much more flexibility. Note that, at least for the short term, the LocalResultType must still expose the same is_deleted/is_tombstone interface as a Wrapped used to, as this is currently needed for delete filtering. A better approach to this is, hopefully, forthcoming. 3. Updated the ISAMTree.h shard and rangequery.h query to use the new interfaces, and adjusted the associated unit tests as well. 4. Dropped the unnecessary "get_data()" function from the ShardInterface concept. 5. Dropped the need to specify a record type in the ShardInterface concept. This is now handled using a required Shard::RECORD member of the Shard class itself, which should expose the name of the record type. * Updates to framework to support new Query/Shard interfaces Pretty extensive adjustments to the framework, particularly to the templates themselves, along with some type-renaming work, to support the new query and shard interfaces. Adjusted the external query interface to take an rvalue reference, rather than a pointer, to the query parameters. * Removed framework-level delete filtering This was causing some issues with the new query interface, and should probably be reworked anyway, so I'm temporarily (TM) removing the feature. * Updated benchmarks + remaining code for new interface --- benchmarks/vldb/ts_mdsp_bench.cpp | 70 --------------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 benchmarks/vldb/ts_mdsp_bench.cpp (limited to 'benchmarks/vldb/ts_mdsp_bench.cpp') diff --git a/benchmarks/vldb/ts_mdsp_bench.cpp b/benchmarks/vldb/ts_mdsp_bench.cpp deleted file mode 100644 index cc0cd99..0000000 --- a/benchmarks/vldb/ts_mdsp_bench.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - */ - -#define ENABLE_TIMER - -#include - -#include "triespline_bsm.h" -#include "psu-util/bentley-saxe.h" -#include "framework/interface/Record.h" -#include "file_util.h" -#include "query/rangecount.h" -#include "psu-util/timer.h" -#include "standard_benchmarks.h" - -typedef std::pair Rec; -typedef de::Record FRec; - -typedef BSMTrieSpline Shard; -typedef de::rc::Parms QP; -typedef psudb::bsm::BentleySaxe Ext; - -void usage(char *progname) { - fprintf(stderr, "%s reccnt datafile queryfile\n", progname); -} - -int main(int argc, char **argv) { - - if (argc < 4) { - usage(argv[0]); - exit(EXIT_FAILURE); - } - - size_t n = atol(argv[1]); - std::string d_fname = std::string(argv[2]); - std::string q_fname = std::string(argv[3]); - - auto extension = new psudb::bsm::BentleySaxe(); - gsl_rng *rng = gsl_rng_alloc(gsl_rng_mt19937); - - auto data = read_sosd_file_pair(d_fname, n); - auto queries = read_range_queries(q_fname, .0001); - - /* warmup structure w/ 10% of records */ - size_t warmup = .1 * n; - insert_records(extension, 0, warmup, data); - - TIMER_INIT(); - - TIMER_START(); - insert_records(extension, warmup, data.size(), data); - TIMER_STOP(); - - auto insert_latency = TIMER_RESULT(); - size_t insert_throughput = (size_t) ((double) (n - warmup) / (double) insert_latency * 1e9); - - TIMER_START(); - run_queries(extension, queries); - TIMER_STOP(); - - auto query_latency = TIMER_RESULT() / queries.size(); - - fprintf(stdout, "%ld\t%ld\n", insert_throughput, query_latency); - - gsl_rng_free(rng); - delete extension; - fflush(stderr); -} - -- cgit v1.2.3