diff options
Diffstat (limited to 'store/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMapStoreConfiguration.java')
-rw-r--r-- | store/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMapStoreConfiguration.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/store/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMapStoreConfiguration.java b/store/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMapStoreConfiguration.java new file mode 100644 index 00000000..be768e98 --- /dev/null +++ b/store/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMapStoreConfiguration.java | |||
@@ -0,0 +1,48 @@ | |||
1 | package org.eclipse.viatra.solver.data.map; | ||
2 | |||
3 | public class VersionedMapStoreConfiguration { | ||
4 | |||
5 | public VersionedMapStoreConfiguration() { | ||
6 | |||
7 | } | ||
8 | public VersionedMapStoreConfiguration(boolean immutableWhenCommiting, boolean sharedNodeCacheInStore, | ||
9 | boolean sharedNodeCacheInStoreGroups) { | ||
10 | super(); | ||
11 | this.immutableWhenCommiting = immutableWhenCommiting; | ||
12 | this.sharedNodeCacheInStore = sharedNodeCacheInStore; | ||
13 | this.sharedNodeCacheInStoreGroups = sharedNodeCacheInStoreGroups; | ||
14 | } | ||
15 | |||
16 | /** | ||
17 | * If true root is replaced with immutable node when committed. Frees up memory | ||
18 | * by releasing immutable nodes, but it may decrease performance by recreating | ||
19 | * immutable nodes upon changes (some evidence). | ||
20 | */ | ||
21 | private boolean immutableWhenCommiting = true; | ||
22 | public boolean isImmutableWhenCommiting() { | ||
23 | return immutableWhenCommiting; | ||
24 | } | ||
25 | |||
26 | /** | ||
27 | * If true, all subnodes are cached within a {@link VersionedMapStore}. It | ||
28 | * decreases the memory requirements. It may increase performance by discovering | ||
29 | * existing immutable copy of a node (some evidence). Additional overhead may | ||
30 | * decrease performance (no example found). The option permits the efficient | ||
31 | * implementation of version deletion. | ||
32 | */ | ||
33 | private boolean sharedNodeCacheInStore = true; | ||
34 | public boolean isSharedNodeCacheInStore() { | ||
35 | return sharedNodeCacheInStore; | ||
36 | } | ||
37 | |||
38 | /** | ||
39 | * If true, all subnodes are cached within a group of | ||
40 | * {@link VersionedMapStoreImpl#createSharedVersionedMapStores(int, ContinousHashProvider, Object, VersionedMapStoreConfiguration)}. | ||
41 | * If {@link VersionedMapStoreConfiguration#sharedNodeCacheInStore} is | ||
42 | * <code>false</code>, then it has currently no impact. | ||
43 | */ | ||
44 | private boolean sharedNodeCacheInStoreGroups = true; | ||
45 | public boolean isSharedNodeCacheInStoreGroups() { | ||
46 | return sharedNodeCacheInStoreGroups; | ||
47 | } | ||
48 | } | ||