diff options
author | 2023-03-01 02:15:50 +0100 | |
---|---|---|
committer | 2023-03-01 11:10:39 +0100 | |
commit | da5d898b3bad6f55efd6619f0abee0ec8aa1de4b (patch) | |
tree | d752bb975189a52aaaa5211e64dec42ea0b152fe /subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/seed/Seed.java | |
parent | chore(deps): bump dependencies (diff) | |
download | refinery-da5d898b3bad6f55efd6619f0abee0ec8aa1de4b.tar.gz refinery-da5d898b3bad6f55efd6619f0abee0ec8aa1de4b.tar.zst refinery-da5d898b3bad6f55efd6619f0abee0ec8aa1de4b.zip |
refactor: more direct access to VIATRA result set
Accessing VIATRA result sets through IQueryResultProvider requires a lot
of indirection, allocations, and locking.
We use reflection instead to have direct access to the underlying
Indexer instead.
Unfortunately, projection to arbitrary tuple masks (with wildcard
entries in a tuple) is completely broken in VIATRA when RETE update
propagation is delayed. While a new, ad-hoc projection indexer gets
added to the RETE net immediately, it is not populated with the
projection results until updates are flushed in the query engine.
Therefore, when encountering an ad-hoc projection for the first time,
the projection results will always be empty (thus usually out of date).
While declaring the desired projections ahead of time would be a
possible solution, for now, we completely remove ad-hoc projection
support. If projections are needed on the ModelQuery level, we should
create an API for declaring projections for each registered Dnf.
Diffstat (limited to 'subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/seed/Seed.java')
-rw-r--r-- | subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/seed/Seed.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/seed/Seed.java b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/seed/Seed.java new file mode 100644 index 00000000..042c2636 --- /dev/null +++ b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/seed/Seed.java | |||
@@ -0,0 +1,14 @@ | |||
1 | package tools.refinery.store.reasoning.translator; | ||
2 | |||
3 | import tools.refinery.store.map.Cursor; | ||
4 | import tools.refinery.store.tuple.Tuple; | ||
5 | |||
6 | public interface Seed<T> { | ||
7 | int arity(); | ||
8 | |||
9 | T getReducedValue(); | ||
10 | |||
11 | T get(Tuple key); | ||
12 | |||
13 | Cursor<Tuple, T> getCursor(T defaultValue, int nodeCount); | ||
14 | } | ||