diff options
Diffstat (limited to 'subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/integration/LazyPlanningAdornments.java')
-rw-r--r-- | subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/integration/LazyPlanningAdornments.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/integration/LazyPlanningAdornments.java b/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/integration/LazyPlanningAdornments.java new file mode 100644 index 00000000..30b3689f --- /dev/null +++ b/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/integration/LazyPlanningAdornments.java | |||
@@ -0,0 +1,41 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2018, Gabor Bergmann, IncQuery Labs Ltd. | ||
3 | * This program and the accompanying materials are made available under the | ||
4 | * terms of the Eclipse Public License v. 2.0 which is available at | ||
5 | * http://www.eclipse.org/legal/epl-v20.html. | ||
6 | * | ||
7 | * SPDX-License-Identifier: EPL-2.0 | ||
8 | *******************************************************************************/ | ||
9 | package tools.refinery.viatra.runtime.localsearch.matcher.integration; | ||
10 | |||
11 | import java.util.Collections; | ||
12 | import java.util.Set; | ||
13 | |||
14 | import tools.refinery.viatra.runtime.matchers.psystem.queries.PParameter; | ||
15 | import tools.refinery.viatra.runtime.matchers.psystem.queries.PQuery; | ||
16 | |||
17 | /** | ||
18 | * This adornment provider does not trigger the preparation of any plans. | ||
19 | * Actual query plans will be computed on demand, when the first actual match request is made with a given adornment. | ||
20 | * | ||
21 | * <p> Caution: this is a safe default adornment provider for {@link GenericLocalSearchResultProvider} only; | ||
22 | * do not use for the EMF-specific LS backend. | ||
23 | * | ||
24 | * <p> The benefits is in execution time: query planning costs for adornments are postponed until first usage | ||
25 | * or even entirely avoided (when adornment is never used in practice). | ||
26 | * However, query evaluation time may become less predictable, as the first matcher call (with a given adornment) | ||
27 | * will include the planning cost. | ||
28 | * For benchmarking or other purposes where this is not desirable, use an adornment provider that demands plan precomputation for all necessary adornments. | ||
29 | * | ||
30 | * @author Gabor Bergmann | ||
31 | * @since 2.1 | ||
32 | * | ||
33 | */ | ||
34 | public class LazyPlanningAdornments implements IAdornmentProvider { | ||
35 | |||
36 | @Override | ||
37 | public Iterable<Set<PParameter>> getAdornments(PQuery query) { | ||
38 | return Collections.emptySet(); | ||
39 | } | ||
40 | |||
41 | } | ||