public class DirectWriteMapDbCacheManyStore extends DirectWriteMapDbStore
DirectWriteMapDbStore that uses an internal cache to store persisted Objects that are part
of multi-valued EReferences to speed-up their access.
Using a cache avoids multiple List deserialization to retrieve the same element, which can be an important
bottleneck in terms of execution time and memory consumption if the underlying model contains very large Collections.
This store can be used as a base store that can be complemented by plugging decorator stores on top of it (see AbstractPersistentStoreDecorator subclasses) to provide additional features such as caching or logging.
DEFAULT_CACHE_SIZE, persistentObjectsCachebackendNO_INDEX| Constructor and Description |
|---|
DirectWriteMapDbCacheManyStore(Resource.Internal resource,
MapDbPersistenceBackend backend)
Constructs a new
DirectWriteMapDbCacheManyStore between the given resource and the
backend. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addReference(PersistentEObject object,
EReference reference,
int index,
PersistentEObject value)
Adds the
value at the index in the content of the reference of the object. |
protected Object |
getFromMap(PersistentEObject object,
EStructuralFeature feature)
Returns the value associated to (
object, feature) in the underlying database. |
addAttribute, clear, contains, eObject, getAttribute, getContainer, getContainingFeature, getFromMap, getReference, indexOf, isSet, lastIndexOf, removeAttribute, removeReference, setAttribute, setReference, size, unset, updateContainment, updateInstanceOfadd, clearAttribute, clearReference, containsAttribute, containsReference, create, get, hashCode, indexOfAttribute, indexOfReference, isEmpty, isSetAttribute, isSetReference, lastIndexOfAttribute, lastIndexOfReference, move, parseProperty, remove, resource, save, serializeToProperty, set, toArray, toArray, unsetAttribute, unsetReferenceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAllInstancespublic DirectWriteMapDbCacheManyStore(Resource.Internal resource, MapDbPersistenceBackend backend)
DirectWriteMapDbCacheManyStore between the given resource and the
backend.resource - the resource to persist and accessbackend - the persistence back-end used to store the modelprotected void addReference(PersistentEObject object, EReference reference, int index, PersistentEObject value)
AbstractDirectWriteStorevalue at the index in the content of the reference of the object.addReference in class DirectWriteMapDbStoreobject - the objectreference - a many-valued reference of the objectindex - an index within the contentvalue - the value to addAbstractDirectWriteStore.add(InternalEObject, EStructuralFeature, int, Object)protected Object getFromMap(PersistentEObject object, EStructuralFeature feature)
DirectWriteMapDbStoreobject, feature) in the underlying database.
This method behaves like: getFromMap(FeatureKey.from(object, feature).
getFromMap in class DirectWriteMapDbStoreobject - the PersistentEObject to look forfeature - the EStructuralFeature of object to look forObject stored in the database if it exists, null otherwise. The returned Object can be a single element or a Collection.DirectWriteMapDbStore.getFromMap(FeatureKey)Copyright © 2013–2017 Atlanmod INRIA LINA Mines Nantes. All rights reserved.