public class DirectWriteBlueprintsCacheManyStore extends DirectWriteBlueprintsStore
DirectWriteBlueprintsStore that uses an internal cache to store Vertex elements that are
part of multi-valued EReferences to speed-up their access.
Large multi-valued EReferences can be an execution time bottleneck in the graph implementation because any
element access forces the underlying database engine to load all the Edges corresponding to the EReference. We overcome this limitation by caching all the Vertex elements involved in multi-valued EReferences the first time they are traversed, limiting database access.
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.
CONTAINER, CONTAINING_FEATURE, CONTENTS, POSITION, SEPARATOR, SIZE_LITERALbackendNO_INDEX| Constructor and Description |
|---|
DirectWriteBlueprintsCacheManyStore(Resource.Internal resource,
BlueprintsPersistenceBackend backend)
Constructs a new
DirectWriteBlueprintsCacheManyStore between the given resource and the
backend. |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
getReference(PersistentEObject object,
EReference reference,
int index)
Returns the value at the
index in the content of the reference of the object. |
addAttribute, addReference, clearAttribute, clearReference, containsAttribute, containsReference, eObject, getAllInstances, getAttribute, getContainer, getContainingFeature, getSize, indexOfAttribute, indexOfReference, isSetAttribute, isSetReference, lastIndexOfAttribute, lastIndexOfReference, reifyVertex, reifyVertex, removeAttribute, removeReference, setAttribute, setReference, size, unsetAttribute, unsetReferencepublic DirectWriteBlueprintsCacheManyStore(Resource.Internal resource, BlueprintsPersistenceBackend backend)
DirectWriteBlueprintsCacheManyStore between the given resource and the
backend.resource - the resource to persist and accessbackend - the persistence back-end used to store the modelprotected Object getReference(PersistentEObject object, EReference reference, int index)
index in the content of the reference of the object.
Caches all the Vertexs traversed to retrieve the element at the given index. This implementation
bypasses the graph API limitation that has to traverse all the Edges connected to the input vertex to
find the one with the given index.
getReference in class DirectWriteBlueprintsStoreobject - the objectreference - a reference of the objectindex - an index within the content or PersistentStore.NO_INDEXEObject if the given EReference is multi-valued, an EObject if it is
single-valued, null if the element doesn't existAbstractDirectWriteStore.get(InternalEObject, EStructuralFeature, int)Copyright © 2013–2017 Atlanmod INRIA LINA Mines Nantes. All rights reserved.