aboutsummaryrefslogtreecommitdiffstats
path: root/store/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMapStoreConfiguration.java
blob: be768e9846a8fa40ff8d130b8ceffe7e268ba2af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package org.eclipse.viatra.solver.data.map;

public class VersionedMapStoreConfiguration {
	
	public VersionedMapStoreConfiguration() {
		
	}
	public VersionedMapStoreConfiguration(boolean immutableWhenCommiting, boolean sharedNodeCacheInStore,
			boolean sharedNodeCacheInStoreGroups) {
		super();
		this.immutableWhenCommiting = immutableWhenCommiting;
		this.sharedNodeCacheInStore = sharedNodeCacheInStore;
		this.sharedNodeCacheInStoreGroups = sharedNodeCacheInStoreGroups;
	}

	/**
	 * If true root is replaced with immutable node when committed. Frees up memory
	 * by releasing immutable nodes, but it may decrease performance by recreating
	 * immutable nodes upon changes (some evidence).
	 */
	private boolean immutableWhenCommiting = true;
	public boolean isImmutableWhenCommiting() {
		return immutableWhenCommiting;
	}

	/**
	 * If true, all subnodes are cached within a {@link VersionedMapStore}. It
	 * decreases the memory requirements. It may increase performance by discovering
	 * existing immutable copy of a node (some evidence). Additional overhead may
	 * decrease performance (no example found). The option permits the efficient
	 * implementation of version deletion.
	 */
	private boolean sharedNodeCacheInStore = true;
	public boolean isSharedNodeCacheInStore() {
		return sharedNodeCacheInStore;
	}
	
	/**
	 * If true, all subnodes are cached within a group of
	 * {@link VersionedMapStoreImpl#createSharedVersionedMapStores(int, ContinousHashProvider, Object, VersionedMapStoreConfiguration)}.
	 * If {@link VersionedMapStoreConfiguration#sharedNodeCacheInStore} is
	 * <code>false</code>, then it has currently no impact.
	 */
	private boolean sharedNodeCacheInStoreGroups = true;
	public boolean isSharedNodeCacheInStoreGroups() {
		return sharedNodeCacheInStoreGroups;
	}
}