Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamas Szabo2022-10-21 11:30:31 +0000
committerTamas Szabo2022-10-21 12:22:14 +0000
commit4c7f4ade7917a6333274ab0f99a9a37980b10d26 (patch)
treeb4f6ccc9ec67a2694c1f3770c426768f3e38522d
parent643edd93063fe19e2028cad0227a0047489cd74d (diff)
downloadorg.eclipse.viatra-4c7f4ade7917a6333274ab0f99a9a37980b10d26.tar.gz
org.eclipse.viatra-4c7f4ade7917a6333274ab0f99a9a37980b10d26.tar.xz
org.eclipse.viatra-4c7f4ade7917a6333274ab0f99a9a37980b10d26.zip
[580745] Changes communication tracker to disable fall-through
altogether for relation evaluation nodes Change-Id: I890014c8623a4c25a403f28c3551a17ddf3e54a9 Signed-off-by: Tamas Szabo <szabta89@github.com>
-rw-r--r--query/plugins/org.eclipse.viatra.query.runtime.matchers/src/org/eclipse/viatra/query/runtime/matchers/psystem/basicdeferred/ExpressionEvaluation.java5
-rw-r--r--query/plugins/org.eclipse.viatra.query.runtime.rete/src/org/eclipse/viatra/query/runtime/rete/network/communication/CommunicationTracker.java5
2 files changed, 7 insertions, 3 deletions
diff --git a/query/plugins/org.eclipse.viatra.query.runtime.matchers/src/org/eclipse/viatra/query/runtime/matchers/psystem/basicdeferred/ExpressionEvaluation.java b/query/plugins/org.eclipse.viatra.query.runtime.matchers/src/org/eclipse/viatra/query/runtime/matchers/psystem/basicdeferred/ExpressionEvaluation.java
index a28276758..1cbef8aec 100644
--- a/query/plugins/org.eclipse.viatra.query.runtime.matchers/src/org/eclipse/viatra/query/runtime/matchers/psystem/basicdeferred/ExpressionEvaluation.java
+++ b/query/plugins/org.eclipse.viatra.query.runtime.matchers/src/org/eclipse/viatra/query/runtime/matchers/psystem/basicdeferred/ExpressionEvaluation.java
@@ -10,7 +10,7 @@ package org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
@@ -69,7 +69,8 @@ public class ExpressionEvaluation extends BaseTypeSafeConstraint {
}
private static Set<PVariable> getPVariablesOfExpression(PBody pBody, IExpressionEvaluator evaluator) {
- Set<PVariable> result = new HashSet<PVariable>();
+ // use a linked set, so that the variables will come in the order of the parameters
+ Set<PVariable> result = new LinkedHashSet<PVariable>();
for (String name : evaluator.getInputParameterNames()) {
PVariable variable = pBody.getOrCreateVariableByName(name);
result.add(variable);
diff --git a/query/plugins/org.eclipse.viatra.query.runtime.rete/src/org/eclipse/viatra/query/runtime/rete/network/communication/CommunicationTracker.java b/query/plugins/org.eclipse.viatra.query.runtime.rete/src/org/eclipse/viatra/query/runtime/rete/network/communication/CommunicationTracker.java
index 13f369e2b..ce41428c7 100644
--- a/query/plugins/org.eclipse.viatra.query.runtime.rete/src/org/eclipse/viatra/query/runtime/rete/network/communication/CommunicationTracker.java
+++ b/query/plugins/org.eclipse.viatra.query.runtime.rete/src/org/eclipse/viatra/query/runtime/rete/network/communication/CommunicationTracker.java
@@ -22,6 +22,7 @@ import org.eclipse.viatra.query.runtime.base.itc.graphimpl.Graph;
import org.eclipse.viatra.query.runtime.matchers.tuple.TupleMask;
import org.eclipse.viatra.query.runtime.rete.aggregation.IAggregatorNode;
import org.eclipse.viatra.query.runtime.rete.boundary.ExternalInputEnumeratorNode;
+import org.eclipse.viatra.query.runtime.rete.eval.RelationEvaluatorNode;
import org.eclipse.viatra.query.runtime.rete.index.DualInputNode;
import org.eclipse.viatra.query.runtime.rete.index.ExistenceNode;
import org.eclipse.viatra.query.runtime.rete.index.Indexer;
@@ -185,7 +186,9 @@ public abstract class CommunicationTracker {
// or true trimming in its sole parent
directParents.size() == 1 && trueTrimming(directParents.iterator().next())))) &&
// disallow fallthrough: external updates should be stored (if updates are delayed)
- (!(node instanceof ExternalInputEnumeratorNode));
+ (!(node instanceof ExternalInputEnumeratorNode)) &&
+ // disallow fallthrough: relation evaluation nodes need to be notified in batch-style, and the batching is done by the mailbox
+ (!(node instanceof RelationEvaluatorNode));
// do additional checks
if (fallThrough) {
// recursive parent groups generate excess updates that should be cancelled after delete&rederive

Back to the top