summaryrefslogtreecommitdiffstats
path: root/include/framework/interface
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-09-25 14:42:44 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2025-09-25 14:42:44 -0400
commitcf5f3bbb0cb58430ed68ad3ebfcefc009e553d71 (patch)
tree4c17bc3169ee195c236cea9c9efda0aef7488e3c /include/framework/interface
parent826c1fff5accbaa6b415acc176a5acbeb5f691b6 (diff)
downloaddynamic-extension-cf5f3bbb0cb58430ed68ad3ebfcefc009e553d71.tar.gz
Code reformatting
Diffstat (limited to 'include/framework/interface')
-rw-r--r--include/framework/interface/Query.h176
-rw-r--r--include/framework/interface/Scheduler.h2
-rw-r--r--include/framework/interface/Shard.h5
3 files changed, 90 insertions, 93 deletions
diff --git a/include/framework/interface/Query.h b/include/framework/interface/Query.h
index 97a973d..4e9a3fb 100644
--- a/include/framework/interface/Query.h
+++ b/include/framework/interface/Query.h
@@ -12,7 +12,6 @@
namespace de {
-
/*
*
*
@@ -23,100 +22,99 @@ template <typename QUERY, typename SHARD,
typename PARAMETERS = typename QUERY::Parameters,
typename LOCAL = typename QUERY::LocalQuery,
typename LOCAL_BUFFER = typename QUERY::LocalQueryBuffer>
-concept QueryInterface =
- requires(PARAMETERS *parameters, LOCAL *local, LOCAL_BUFFER *buffer_query,
- SHARD *shard, std::vector<LOCAL *> &local_queries,
- std::vector<LOCAL_RESULT> &local_results, RESULT &result,
- BufferView<typename SHARD::RECORD> *bv) {
- /*
- * Given a set of query parameters and a shard, return a local query
- * object for that shard.
- */
- {
- QUERY::local_preproc(shard, parameters)
- } -> std::convertible_to<LOCAL *>;
+concept QueryInterface = requires(PARAMETERS *parameters, LOCAL *local,
+ LOCAL_BUFFER *buffer_query, SHARD *shard,
+ std::vector<LOCAL *> &local_queries,
+ std::vector<LOCAL_RESULT> &local_results,
+ RESULT &result,
+ BufferView<typename SHARD::RECORD> *bv) {
+ /*
+ * Given a set of query parameters and a shard, return a local query
+ * object for that shard.
+ */
+ { QUERY::local_preproc(shard, parameters) } -> std::convertible_to<LOCAL *>;
- /*
- * Given a set of query parameters and a buffer view, return a local
- * query object for the buffer.
- * NOTE: for interface reasons, the pointer to the buffer view MUST be
- * stored inside of the local query object. The future buffer
- * query routine will access the buffer by way of this pointer.
- */
- {
- QUERY::local_preproc_buffer(bv, parameters)
- } -> std::convertible_to<LOCAL_BUFFER *>;
+ /*
+ * Given a set of query parameters and a buffer view, return a local
+ * query object for the buffer.
+ * NOTE: for interface reasons, the pointer to the buffer view MUST be
+ * stored inside of the local query object. The future buffer
+ * query routine will access the buffer by way of this pointer.
+ */
+ {
+ QUERY::local_preproc_buffer(bv, parameters)
+ } -> std::convertible_to<LOCAL_BUFFER *>;
- /*
- * Given a full set of local queries, and the buffer query, make any
- * necessary adjustments to the local queries in-place, to account for
- * global information. If no additional processing is required, this
- * function can be left empty.
- */
- { QUERY::distribute_query(parameters, local_queries, buffer_query) };
+ /*
+ * Given a full set of local queries, and the buffer query, make any
+ * necessary adjustments to the local queries in-place, to account for
+ * global information. If no additional processing is required, this
+ * function can be left empty.
+ */
+ {QUERY::distribute_query(parameters, local_queries, buffer_query)};
- /*
- * Answer the local query, defined by `local` against `shard` and return
- * a vector of LOCAL_RESULT objects defining the query result.
- */
- { QUERY::local_query(shard, local) } -> std::convertible_to<LOCAL_RESULT>;
+ /*
+ * Answer the local query, defined by `local` against `shard` and return
+ * a vector of LOCAL_RESULT objects defining the query result.
+ */
+ { QUERY::local_query(shard, local) } -> std::convertible_to<LOCAL_RESULT>;
- /*
- * Answer the local query defined by `local` against the buffer (which
- * should be accessed by a pointer inside of `local`) and return a vector
- * of LOCAL_RESULT objects defining the query result.
- */
- {
- QUERY::local_query_buffer(buffer_query)
- } -> std::convertible_to<LOCAL_RESULT>;
+ /*
+ * Answer the local query defined by `local` against the buffer (which
+ * should be accessed by a pointer inside of `local`) and return a vector
+ * of LOCAL_RESULT objects defining the query result.
+ */
+ {
+ QUERY::local_query_buffer(buffer_query)
+ } -> std::convertible_to<LOCAL_RESULT>;
- /*
- * Process the local results from the buffer and all of the shards,
- * stored in `local_results`, and insert the associated ResultType
- * objects into the `result` vector, which represents the final result
- * of the query. Updates to this vector are done in-place.
- */
- { QUERY::combine(local_results, parameters, result) };
+ /*
+ * Process the local results from the buffer and all of the shards,
+ * stored in `local_results`, and insert the associated ResultType
+ * objects into the `result` vector, which represents the final result
+ * of the query. Updates to this vector are done in-place.
+ */
+ {QUERY::combine(local_results, parameters, result)};
- /*
- * Process the post-combine `result` vector of ResultType objects,
- * in the context of the global and local query parameters, to determine
- * if the query should be repeated. If so, make any necessary adjustments
- * to the local query objects and return True. Otherwise, return False.
- *
- * If no repetition is needed for a given problem type, simply return
- * False immediately and the query will end.
- */
- {
- QUERY::repeat(parameters, result, local_queries, buffer_query)
- } -> std::same_as<bool>;
+ /*
+ * Process the post-combine `result` vector of ResultType objects,
+ * in the context of the global and local query parameters, to determine
+ * if the query should be repeated. If so, make any necessary adjustments
+ * to the local query objects and return True. Otherwise, return False.
+ *
+ * If no repetition is needed for a given problem type, simply return
+ * False immediately and the query will end.
+ */
+ {
+ QUERY::repeat(parameters, result, local_queries, buffer_query)
+ } -> std::same_as<bool>;
- /*
- * If this flag is True, then the query will immediately stop and return
- * a result as soon as the first non-deleted LocalRecordType is found.
- * Otherwise, every Shard and the buffer will be queried and the results
- * merged, like normal.
- *
- * This is largely an optimization flag for use with point-lookup, or
- * other single-record result queries
- */
- { QUERY::EARLY_ABORT } -> std::convertible_to<bool>;
+ /*
+ * If this flag is True, then the query will immediately stop and return
+ * a result as soon as the first non-deleted LocalRecordType is found.
+ * Otherwise, every Shard and the buffer will be queried and the results
+ * merged, like normal.
+ *
+ * This is largely an optimization flag for use with point-lookup, or
+ * other single-record result queries
+ */
+ { QUERY::EARLY_ABORT } -> std::convertible_to<bool>;
- /*
- * If false, the built-in delete filtering that the framework can
- * apply to the local results, prior to calling combine, will be skipped.
- * This general filtering can be inefficient, particularly for tombstone
- * -based deletes, and so if a more efficient manual filtering can be
- * performed, it is worth setting this to True and doing that filtering
- * in the combine step.
- *
- * If deletes are not a consideration for your problem, it's also best
- * to turn this off, as it'll avoid the framework making an extra pass
- * over the local results prior to combining them.
- *
- * TODO: Temporarily disabling this, as we've dropped framework-level
- * delete filtering for the time being.
- */
- /* { QUERY::SKIP_DELETE_FILTER } -> std::convertible_to<bool>; */
- };
+ /*
+ * If false, the built-in delete filtering that the framework can
+ * apply to the local results, prior to calling combine, will be skipped.
+ * This general filtering can be inefficient, particularly for tombstone
+ * -based deletes, and so if a more efficient manual filtering can be
+ * performed, it is worth setting this to True and doing that filtering
+ * in the combine step.
+ *
+ * If deletes are not a consideration for your problem, it's also best
+ * to turn this off, as it'll avoid the framework making an extra pass
+ * over the local results prior to combining them.
+ *
+ * TODO: Temporarily disabling this, as we've dropped framework-level
+ * delete filtering for the time being.
+ */
+ /* { QUERY::SKIP_DELETE_FILTER } -> std::convertible_to<bool>; */
+};
} // namespace de
diff --git a/include/framework/interface/Scheduler.h b/include/framework/interface/Scheduler.h
index d76a6c8..0724bce 100644
--- a/include/framework/interface/Scheduler.h
+++ b/include/framework/interface/Scheduler.h
@@ -14,7 +14,7 @@ template <typename SchedType>
concept SchedulerInterface = requires(SchedType s, size_t i, void *vp,
de::Job j) {
{SchedType(i, i)};
- {s.schedule_job(j, i, vp, i)} -> std::convertible_to<void>;
+ { s.schedule_job(j, i, vp, i) } -> std::convertible_to<void>;
{s.shutdown()};
{s.print_statistics()};
};
diff --git a/include/framework/interface/Shard.h b/include/framework/interface/Shard.h
index fb5ce1a..e3a2de4 100644
--- a/include/framework/interface/Shard.h
+++ b/include/framework/interface/Shard.h
@@ -14,8 +14,8 @@ namespace de {
template <typename SHARD>
concept ShardInterface = RecordInterface<typename SHARD::RECORD> &&
- requires(SHARD shard, const std::vector<const SHARD *> &shard_vector, bool b,
- BufferView<typename SHARD::RECORD> bv,
+ requires(SHARD shard, const std::vector<const SHARD *> &shard_vector,
+ bool b, BufferView<typename SHARD::RECORD> bv,
typename SHARD::RECORD rec) {
/* construct a shard from a vector of shards of the same type */
{SHARD(shard_vector)};
@@ -52,7 +52,6 @@ concept ShardInterface = RecordInterface<typename SHARD::RECORD> &&
* use only at the moment
*/
{ shard.get_aux_memory_usage() } -> std::convertible_to<size_t>;
-
};
template <typename SHARD>