diff options
Diffstat (limited to 'subprojects/viatra-runtime-matchers/src/main/java/tools/refinery/viatra/runtime/matchers/scopes/IStorageBackend.java')
-rw-r--r-- | subprojects/viatra-runtime-matchers/src/main/java/tools/refinery/viatra/runtime/matchers/scopes/IStorageBackend.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime-matchers/src/main/java/tools/refinery/viatra/runtime/matchers/scopes/IStorageBackend.java b/subprojects/viatra-runtime-matchers/src/main/java/tools/refinery/viatra/runtime/matchers/scopes/IStorageBackend.java new file mode 100644 index 00000000..16f40358 --- /dev/null +++ b/subprojects/viatra-runtime-matchers/src/main/java/tools/refinery/viatra/runtime/matchers/scopes/IStorageBackend.java | |||
@@ -0,0 +1,53 @@ | |||
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.matchers.scopes; | ||
10 | |||
11 | import tools.refinery.viatra.runtime.matchers.context.IInputKey; | ||
12 | import tools.refinery.viatra.runtime.matchers.scopes.tables.ITableContext; | ||
13 | import tools.refinery.viatra.runtime.matchers.scopes.tables.ITableWriterBinary; | ||
14 | import tools.refinery.viatra.runtime.matchers.scopes.tables.ITableWriterUnary; | ||
15 | |||
16 | /** | ||
17 | * An abstract storage backend that instantiates tables and coordinates transactions. | ||
18 | * | ||
19 | * <p><strong>EXPERIMENTAL</strong>. This class or interface has been added as | ||
20 | * part of a work in progress. There is no guarantee that this API will | ||
21 | * work or that it will remain the same. | ||
22 | * | ||
23 | * @author Gabor Bergmann | ||
24 | * | ||
25 | * @since 2.1 | ||
26 | */ | ||
27 | public interface IStorageBackend { | ||
28 | |||
29 | |||
30 | /** | ||
31 | * Marks the beginning of a transaction. | ||
32 | * In transaction mode, table updates may be temporarily delayed ({@link tools.refinery.viatra.runtime.matchers.scopes.tables.IIndexTable} methods may return stale answers) for better performance. | ||
33 | */ | ||
34 | void startTransaction(); | ||
35 | /** | ||
36 | * Marks the end of a transaction. | ||
37 | * Any updates delayed during the transaction must now be flushed. | ||
38 | */ | ||
39 | void finishTransaction(); | ||
40 | |||
41 | /** | ||
42 | * Creates an index table for a simple value set. | ||
43 | * @param unique client promises to only insert a given tuple with multiplicity one | ||
44 | */ | ||
45 | ITableWriterUnary.Table<Object> createUnaryTable(IInputKey key, ITableContext tableContext, boolean unique); | ||
46 | /** | ||
47 | * Creates an index table for a simple source-target bidirectional mapping. | ||
48 | * @param unique client promises to only insert a given tuple with multiplicity one | ||
49 | */ | ||
50 | ITableWriterBinary.Table<Object,Object> createBinaryTable(IInputKey key, ITableContext tableContext, boolean unique); | ||
51 | |||
52 | |||
53 | } | ||