public class DirectWriteBlueprintsCacheManyStore extends DirectWriteBlueprintsStore
DirectWriteBlueprintsStore
that uses an internal cache to store Vertex
elements that are
part of multi-valued EReference
s to speed-up their access.
Large multi-valued EReference
s can be an execution time bottleneck in the graph implementation because any
element access forces the underlying database engine to load all the Edge
s corresponding to the EReference
. We overcome this limitation by caching all the Vertex
elements involved in multi-valued EReference
s 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_LITERAL
backend
NO_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, unsetReference
public 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 Vertex
s traversed to retrieve the element at the given index
. This implementation
bypasses the graph API limitation that has to traverse all the Edge
s connected to the input vertex to
find the one with the given index
.
getReference
in class DirectWriteBlueprintsStore
object
- the objectreference
- a reference of the object
index
- an index within the content or PersistentStore.NO_INDEX
EObject
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.