Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbergmann2018-07-08 11:48:39 +0000
committerZoltan Ujhelyi2018-07-13 07:31:36 +0000
commit03d1fb471bbc41b51fc9710d92e9107eeec7f62d (patch)
tree27fa677433e2c41503993ba6fd6ff39861480007
parentdba5a5b6b1212392cf0e32ee77b4e8fc783b17b8 (diff)
downloadorg.eclipse.viatra-03d1fb471bbc41b51fc9710d92e9107eeec7f62d.tar.gz
org.eclipse.viatra-03d1fb471bbc41b51fc9710d92e9107eeec7f62d.tar.xz
org.eclipse.viatra-03d1fb471bbc41b51fc9710d92e9107eeec7f62d.zip
[536794] Make LS flattener predicate aware of BackendRequirement logic
Change-Id: I24502fc906ac5591052bb0f061f12b499d6f7e97 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=536794 Signed-off-by: bergmann <bergmann@mit.bme.hu> Signed-off-by: Zoltan Ujhelyi <zoltan.ujhelyi@incquerylabs.com>
-rw-r--r--query/plugins/org.eclipse.viatra.query.runtime.localsearch/src/org/eclipse/viatra/query/runtime/localsearch/matcher/integration/DontFlattenIncrementalPredicate.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/query/plugins/org.eclipse.viatra.query.runtime.localsearch/src/org/eclipse/viatra/query/runtime/localsearch/matcher/integration/DontFlattenIncrementalPredicate.java b/query/plugins/org.eclipse.viatra.query.runtime.localsearch/src/org/eclipse/viatra/query/runtime/localsearch/matcher/integration/DontFlattenIncrementalPredicate.java
index 299d3516a..04cb77270 100644
--- a/query/plugins/org.eclipse.viatra.query.runtime.localsearch/src/org/eclipse/viatra/query/runtime/localsearch/matcher/integration/DontFlattenIncrementalPredicate.java
+++ b/query/plugins/org.eclipse.viatra.query.runtime.localsearch/src/org/eclipse/viatra/query/runtime/localsearch/matcher/integration/DontFlattenIncrementalPredicate.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.viatra.query.runtime.localsearch.matcher.integration;
-import org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackendFactory;
import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
+import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint.BackendRequirement;
import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
import org.eclipse.viatra.query.runtime.matchers.psystem.rewriters.IFlattenCallPredicate;
/**
- * This implementation forbids flattening of patterns marked to be executed with a backend other than the
- * Local search engine (e.g. Rete). This makes is possible for the user to configure hybrid matching via using
+ * This implementation forbids flattening of patterns marked to be executed with a caching / incremental backend.
+ * This makes is possible for the user to configure hybrid matching via using
* the 'search' and 'incremental keywords in the pattern definition file.
*
* @since 1.5
@@ -29,8 +29,18 @@ public class DontFlattenIncrementalPredicate implements IFlattenCallPredicate {
public boolean shouldFlatten(PositivePatternCall positivePatternCall) {
QueryEvaluationHint evaluationHints = positivePatternCall.getReferredQuery().getEvaluationHints();
if (evaluationHints == null) return true;
- IQueryBackendFactory configuredBackend = evaluationHints.getQueryBackendFactory();
- return configuredBackend == null || !configuredBackend.isCaching();
+
+ BackendRequirement backendRequirementType = evaluationHints.getQueryBackendRequirementType();
+ switch(backendRequirementType) {
+ case DEFAULT_CACHING:
+ return false;
+ case SPECIFIC:
+ return !evaluationHints.getQueryBackendFactory().isCaching();
+ case UNSPECIFIED:
+ case DEFAULT_SEARCH:
+ default:
+ return true;
+ }
}
}

Back to the top