From 9fe190f5d500e22b0894095e7c917f9c652e0a64 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Wed, 20 Mar 2024 17:30:14 -0400 Subject: Updates/progress towards succinct trie support --- include/framework/interface/Record.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include/framework/interface') diff --git a/include/framework/interface/Record.h b/include/framework/interface/Record.h index 5b9f307..f4105c6 100644 --- a/include/framework/interface/Record.h +++ b/include/framework/interface/Record.h @@ -97,9 +97,17 @@ template struct Record { K key; V value; - uint32_t header = 0; - inline bool operator<(const Record& other) const { + Record &operator=(const Record &other) { + this->key = K(); + + this->key = other.key; + this->value = other.value; + + return *this; + } + + inline bool operator<(const Record& other) const { return key < other.key || (key == other.key && value < other.value); } -- cgit v1.2.3 From 10c2348664a0341764b6a773aaa58f2af93075ad Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Fri, 22 Mar 2024 14:03:49 -0400 Subject: Record.h: Removed manual constructor and adjusted wrapped header fields --- include/framework/interface/Record.h | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'include/framework/interface') diff --git a/include/framework/interface/Record.h b/include/framework/interface/Record.h index f4105c6..39880bd 100644 --- a/include/framework/interface/Record.h +++ b/include/framework/interface/Record.h @@ -54,6 +54,11 @@ concept WrappedInterface = RecordInterface && requires(R r, R s, bool b) { {r.is_deleted()} -> std::convertible_to; {r.set_tombstone(b)}; {r.is_tombstone()} -> std::convertible_to; + {r.set_timestamp()}; + {r.get_timestamp()} -> std::convertible_to; + {r.clear_timestamp()}; + {r.is_deleted()} -> std::convertible_to; + {r.set_visible()}; {r < s} -> std::convertible_to; {r == s} ->std::convertible_to; }; @@ -71,9 +76,29 @@ struct Wrapped { return header & 2; } + inline void set_visible() { + header |= 4; + } + + inline bool is_visible() const { + return header & 4; + } + + inline void set_timestamp(int ts) { + header |= (ts << 3); + } + + inline int get_timestamp() const { + return header >> 3; + } + + inline void clear_timestamp() { + header &= 7; + } + inline void set_tombstone(bool val=true) { if (val) { - header |= val; + header |= 1; } else { header &= 0; } @@ -98,15 +123,6 @@ struct Record { K key; V value; - Record &operator=(const Record &other) { - this->key = K(); - - this->key = other.key; - this->value = other.value; - - return *this; - } - inline bool operator<(const Record& other) const { return key < other.key || (key == other.key && value < other.value); } -- cgit v1.2.3 From 0e2d10f10974def7cd86b6b3529d7ffce9285f11 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Fri, 22 Mar 2024 14:18:40 -0400 Subject: Record.h: Fixed wrapped record concept --- include/framework/interface/Record.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/framework/interface') diff --git a/include/framework/interface/Record.h b/include/framework/interface/Record.h index 39880bd..d380f9b 100644 --- a/include/framework/interface/Record.h +++ b/include/framework/interface/Record.h @@ -47,17 +47,17 @@ concept AlexInterface = KVPInterface && requires(R r) { }; template -concept WrappedInterface = RecordInterface && requires(R r, R s, bool b) { +concept WrappedInterface = RecordInterface && requires(R r, R s, bool b, int i) { {r.header} -> std::convertible_to; r.rec; {r.set_delete()}; {r.is_deleted()} -> std::convertible_to; {r.set_tombstone(b)}; {r.is_tombstone()} -> std::convertible_to; - {r.set_timestamp()}; + {r.set_timestamp(i)}; {r.get_timestamp()} -> std::convertible_to; {r.clear_timestamp()}; - {r.is_deleted()} -> std::convertible_to; + {r.is_visible()} -> std::convertible_to; {r.set_visible()}; {r < s} -> std::convertible_to; {r == s} ->std::convertible_to; -- cgit v1.2.3 From b25beb13773072c3b143842b45a7c32a1108f347 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 15 Apr 2024 14:00:27 -0400 Subject: Updated FSTrie to use const char * instead of std::string Note: this requires the caller to manage the memory of the strings --- include/framework/interface/Record.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/framework/interface') diff --git a/include/framework/interface/Record.h b/include/framework/interface/Record.h index d380f9b..19ccadd 100644 --- a/include/framework/interface/Record.h +++ b/include/framework/interface/Record.h @@ -132,6 +132,23 @@ struct Record { } }; +template +struct Record { + const char* key; + V value; + size_t len; + + inline bool operator<(const Record& other) const { + size_t n = std::min(len, other.len) + 1; + return strncmp(key, other.key, n) < 0; + } + + inline bool operator==(const Record& other) const { + size_t n = std::min(len, other.len) + 1; + return strncmp(key, other.key, n) == 0; + } +}; + template struct WeightedRecord { K key; -- cgit v1.2.3 From 438feac7e56fee425d9c6f1a43298ff9dc5b71d1 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Fri, 19 Apr 2024 17:38:16 -0400 Subject: Properly implemented support for iteratively decomposable problems --- include/framework/interface/Query.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/framework/interface') diff --git a/include/framework/interface/Query.h b/include/framework/interface/Query.h index 3d487f0..577d6cd 100644 --- a/include/framework/interface/Query.h +++ b/include/framework/interface/Query.h @@ -13,17 +13,19 @@ namespace de{ template -concept QueryInterface = requires(void *p, S *sh, std::vector &s, std::vector>> &rv, BufferView *bv) { +concept QueryInterface = requires(void *p, S *sh, std::vector &s, std::vector>> &rv, BufferView *bv, std::vector &resv) { {Q::get_query_state(sh, p)} -> std::convertible_to; {Q::get_buffer_query_state(bv, p)} -> std::convertible_to; {Q::process_query_states(p, s, p)}; {Q::query(sh, p, p)} -> std::convertible_to>>; {Q::buffer_query(p, p)} -> std::convertible_to>>; - {Q::merge(rv, p)} -> std::convertible_to>; + {Q::merge(rv, p, resv)}; {Q::delete_query_state(p)} -> std::same_as; {Q::delete_buffer_query_state(p)} -> std::same_as; + {Q::repeat(p, resv, s, p)} -> std::same_as; + {Q::EARLY_ABORT} -> std::convertible_to; {Q::SKIP_DELETE_FILTER} -> std::convertible_to; }; -- cgit v1.2.3