package org.simantics.db.impl.query;
+import org.simantics.db.ObjectResourceIdMap;
import org.simantics.db.RelationInfo;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.impl.graph.ReadGraphImpl;
existing.clearResult(querySupport);
existing.setPending();
objectsMap.put(keyR2(r1,r2), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerObjects(ReadGraphImpl graph, int r1, int r2, CacheEntry parent, ListenerBase listener, IntProcedure procedure) throws DatabaseException {
- if(parent == null && listener == null) {
+ public static void runnerObjects(ReadGraphImpl graph, int r1, int r2, CacheEntry parent, ListenerBase listener, IntProcedure procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r1,r2)) {
Objects.computeForEach(graph, r1,r2, null, procedure);
return;
}
- QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureObjects;
Objects entry = (Objects)cache.getOrCreateObjects(r1,r2);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
existing.clearResult(querySupport);
existing.setPending();
statementsMap.put(keyR2(r1,r2), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerStatements(ReadGraphImpl graph, int r1, int r2, CacheEntry parent, ListenerBase listener, TripleIntProcedure procedure) throws DatabaseException {
- if(parent == null && listener == null) {
+ public static void runnerStatements(ReadGraphImpl graph, int r1, int r2, CacheEntry parent, ListenerBase listener, TripleIntProcedure procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r1,r2)) {
Statements.computeForEach(graph, r1,r2, null, procedure);
return;
}
- QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureStatements;
Statements entry = (Statements)cache.getOrCreateStatements(r1,r2);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
existing.clearResult(querySupport);
existing.setPending();
directObjectsMap.put(keyR2(r1,r2), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerDirectObjects(ReadGraphImpl graph, int r1, int r2, CacheEntry parent, ListenerBase listener, IntProcedure procedure) throws DatabaseException {
- if(parent == null && listener == null) {
+ public static void runnerDirectObjects(ReadGraphImpl graph, int r1, int r2, CacheEntry parent, ListenerBase listener, IntProcedure procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r1,r2)) {
DirectObjects.computeForEach(graph, r1,r2, null, procedure);
return;
}
- QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureDirectObjects;
DirectObjects entry = (DirectObjects)cache.getOrCreateDirectObjects(r1,r2);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
existing.clearResult(querySupport);
existing.setPending();
relationInfoQueryMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerRelationInfoQuery(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<RelationInfo> procedure) throws DatabaseException {
- if(parent == null && listener == null) {
+ public static void runnerRelationInfoQuery(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<RelationInfo> procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r)) {
RelationInfoQuery.computeForEach(graph, r, null, procedure);
return;
}
- QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureRelationInfoQuery;
RelationInfoQuery entry = (RelationInfoQuery)cache.getOrCreateRelationInfoQuery(r);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
existing.clearResult(querySupport);
existing.setPending();
uRIToResourceMap.put(keyID(id), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerURIToResource(ReadGraphImpl graph, String id, CacheEntry parent, ListenerBase listener, InternalProcedure<Integer> procedure) throws DatabaseException {
- if(parent == null && listener == null) {
+ public static void runnerURIToResource(ReadGraphImpl graph, String id, CacheEntry parent, ListenerBase listener, InternalProcedure<Integer> procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, id)) {
URIToResource.computeForEach(graph, id, null, procedure);
return;
}
- QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureURIToResource;
URIToResource entry = (URIToResource)cache.getOrCreateURIToResource(id);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
existing.clearResult(querySupport);
existing.setPending();
valueQueryMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerValueQuery(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<byte[]> procedure) throws DatabaseException {
- if(parent == null && listener == null) {
+ public static void runnerValueQuery(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<byte[]> procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r)) {
ValueQuery.computeForEach(graph, r, null, procedure);
return;
}
- QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureValueQuery;
ValueQuery entry = (ValueQuery)cache.getOrCreateValueQuery(r);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
existing.clearResult(querySupport);
existing.setPending();
orderedSetMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerOrderedSet(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, IntProcedure procedure) throws DatabaseException {
- if(parent == null && listener == null) {
+ public static void runnerOrderedSet(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, IntProcedure procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r)) {
OrderedSet.computeForEach(graph, r, null, procedure);
return;
}
- QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureOrderedSet;
OrderedSet entry = (OrderedSet)cache.getOrCreateOrderedSet(r);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
existing.clearResult(querySupport);
existing.setPending();
principalTypesMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerPrincipalTypes(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, IntProcedure procedure) throws DatabaseException {
- if(parent == null && listener == null) {
+ public static void runnerPrincipalTypes(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, IntProcedure procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r)) {
PrincipalTypes.computeForEach(graph, r, null, procedure);
return;
}
- QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedurePrincipalTypes;
PrincipalTypes entry = (PrincipalTypes)cache.getOrCreatePrincipalTypes(r);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
existing.clearResult(querySupport);
existing.setPending();
directPredicatesMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerDirectPredicates(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<IntSet> procedure) throws DatabaseException {
- if(parent == null && listener == null) {
+ public static void runnerDirectPredicates(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<IntSet> procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r)) {
DirectPredicates.computeForEach(graph, r, null, procedure);
return;
}
- QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureDirectPredicates;
DirectPredicates entry = (DirectPredicates)cache.getOrCreateDirectPredicates(r);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
existing.clearResult(querySupport);
existing.setPending();
predicatesMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerPredicates(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<IntSet> procedure) throws DatabaseException {
- if(parent == null && listener == null) {
+ public static void runnerPredicates(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<IntSet> procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r)) {
Predicates.computeForEach(graph, r, null, procedure);
return;
}
- QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedurePredicates;
Predicates entry = (Predicates)cache.getOrCreatePredicates(r);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
existing.clearResult(querySupport);
existing.setPending();
readEntryMap.put(id(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerReadEntry(ReadGraphImpl graph, Read<?> r, CacheEntry parent, ListenerBase listener, AsyncProcedure procedure) throws DatabaseException {
- if(parent == null && listener == null) {
+ public static void runnerReadEntry(ReadGraphImpl graph, Read<?> r, CacheEntry parent, ListenerBase listener, AsyncProcedure procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r)) {
ReadEntry.computeForEach(graph, r, null, procedure);
return;
}
- QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureReadEntry;
ReadEntry entry = (ReadEntry)cache.getOrCreateReadEntry(r);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
}
}
+ AsyncReadEntry getOrCreateAsyncReadEntry(AsyncRead<?> r) throws DatabaseException {
+ AsyncReadEntry existing = null;
+ synchronized(asyncReadEntryMap) {
+ existing = (AsyncReadEntry)asyncReadEntryMap.get(r);
+ if(existing == null) {
+ existing = new AsyncReadEntry(r);
+ existing.clearResult(querySupport);
+ existing.setPending();
+ asyncReadEntryMap.put(id(r), existing);
+ size++;
+ return existing;
+ }
+ if(existing.requiresComputation()) {
+ existing.setPending();
+ return existing;
+ }
+ }
+ if(existing.isPending()) waitPending(existing);
+ return existing;
+ }
+
+ void remove(AsyncReadEntry entry) {
+ synchronized(asyncReadEntryMap) {
+ asyncReadEntryMap.remove(entry.request);
+ }
+ }
+
+ public static void runnerAsyncReadEntry(ReadGraphImpl graph, AsyncRead<?> r, CacheEntry parent, ListenerBase listener, AsyncProcedure procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r)) {
+ AsyncReadEntry.computeForEach(graph, r, null, procedure);
+ return;
+ }
+ if(procedure == null) procedure = emptyProcedureAsyncReadEntry;
+ AsyncReadEntry entry = (AsyncReadEntry)cache.getOrCreateAsyncReadEntry(r);
+ ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
+ if(entry.isReady()) entry.performFromCache(graph, procedure);
+ else {
+ AsyncReadEntry.computeForEach(graph, r, entry, procedure);
+ if(listenerEntry != null) cache.primeListenerEntry(listenerEntry, entry.getResult());
+ }
+ }
+
Types getOrCreateTypes(int r) throws DatabaseException {
Types existing = null;
synchronized(typesMap) {
existing.clearResult(querySupport);
existing.setPending();
typesMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerTypes(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<IntSet> procedure) throws DatabaseException {
- if(parent == null && listener == null) {
+ public static void runnerTypes(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<IntSet> procedure) throws DatabaseException {
+ QueryCache cache = graph.processor.cache;
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r)) {
Types.computeForEach(graph, r, null, procedure);
return;
}
- QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureTypes;
Types entry = (Types)cache.getOrCreateTypes(r);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
}
}
- AssertedStatements getOrCreateAssertedStatements(int r1, int r2) throws DatabaseException {
- AssertedStatements existing = null;
- synchronized(assertedStatementsMap) {
- existing = (AssertedStatements)assertedStatementsMap.get(r1,r2);
+ ChildMap getOrCreateChildMap(int r) throws DatabaseException {
+ ChildMap existing = null;
+ synchronized(childMapMap) {
+ existing = (ChildMap)childMapMap.get(r);
if(existing == null) {
- existing = new AssertedStatements(r1,r2);
+ existing = new ChildMap(r);
existing.clearResult(querySupport);
existing.setPending();
- assertedStatementsMap.put(keyR2(r1,r2), existing);
+ childMapMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
return existing;
}
- void remove(AssertedStatements entry) {
- synchronized(assertedStatementsMap) {
- assertedStatementsMap.remove(entry.id);
+ void remove(ChildMap entry) {
+ synchronized(childMapMap) {
+ childMapMap.remove(entry.id);
}
}
- static void runnerAssertedStatements(ReadGraphImpl graph, int r1, int r2, CacheEntry parent, ListenerBase listener, TripleIntProcedure procedure) throws DatabaseException {
+ public static void runnerChildMap(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<ObjectResourceIdMap<String>> procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
- if(procedure == null) procedure = emptyProcedureAssertedStatements;
- AssertedStatements entry = (AssertedStatements)cache.getOrCreateAssertedStatements(r1,r2);
+ if(parent == null && listener == null && !cache.shouldCache(graph.processor, r)) {
+ ChildMap.computeForEach(graph, r, null, procedure);
+ return;
+ }
+ if(procedure == null) procedure = emptyProcedureChildMap;
+ ChildMap entry = (ChildMap)cache.getOrCreateChildMap(r);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
if(entry.isReady()) entry.performFromCache(graph, procedure);
else {
- entry.compute(graph, procedure);
+ ChildMap.computeForEach(graph, r, entry, procedure);
if(listenerEntry != null) cache.primeListenerEntry(listenerEntry, entry.getResult());
}
}
- NamespaceIndex getOrCreateNamespaceIndex(String id) throws DatabaseException {
- NamespaceIndex existing = null;
- synchronized(namespaceIndexMap) {
- existing = (NamespaceIndex)namespaceIndexMap.get(id);
+ AssertedStatements getOrCreateAssertedStatements(int r1, int r2) throws DatabaseException {
+ AssertedStatements existing = null;
+ synchronized(assertedStatementsMap) {
+ existing = (AssertedStatements)assertedStatementsMap.get(r1,r2);
if(existing == null) {
- existing = new NamespaceIndex(id);
+ existing = new AssertedStatements(r1,r2);
existing.clearResult(querySupport);
existing.setPending();
- namespaceIndexMap.put(keyID(id), existing);
+ assertedStatementsMap.put(keyR2(r1,r2), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
return existing;
}
- void remove(NamespaceIndex entry) {
- synchronized(namespaceIndexMap) {
- namespaceIndexMap.remove(entry.id);
+ void remove(AssertedStatements entry) {
+ synchronized(assertedStatementsMap) {
+ assertedStatementsMap.remove(entry.id);
}
}
- static void runnerNamespaceIndex(ReadGraphImpl graph, String id, CacheEntry parent, ListenerBase listener, InternalProcedure<TObjectIntHashMap<String>> procedure) throws DatabaseException {
+ public static void runnerAssertedStatements(ReadGraphImpl graph, int r1, int r2, CacheEntry parent, ListenerBase listener, TripleIntProcedure procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
- if(procedure == null) procedure = emptyProcedureNamespaceIndex;
- NamespaceIndex entry = (NamespaceIndex)cache.getOrCreateNamespaceIndex(id);
+ if(procedure == null) procedure = emptyProcedureAssertedStatements;
+ AssertedStatements entry = (AssertedStatements)cache.getOrCreateAssertedStatements(r1,r2);
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
if(entry.isReady()) entry.performFromCache(graph, procedure);
else {
existing.clearResult(querySupport);
existing.setPending();
assertedPredicatesMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerAssertedPredicates(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, IntProcedure procedure) throws DatabaseException {
+ public static void runnerAssertedPredicates(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, IntProcedure procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureAssertedPredicates;
AssertedPredicates entry = (AssertedPredicates)cache.getOrCreateAssertedPredicates(r);
existing.clearResult(querySupport);
existing.setPending();
directSuperRelationsMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerDirectSuperRelations(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, IntProcedure procedure) throws DatabaseException {
+ public static void runnerDirectSuperRelations(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, IntProcedure procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureDirectSuperRelations;
DirectSuperRelations entry = (DirectSuperRelations)cache.getOrCreateDirectSuperRelations(r);
existing.clearResult(querySupport);
existing.setPending();
superTypesMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerSuperTypes(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<IntSet> procedure) throws DatabaseException {
+ public static void runnerSuperTypes(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<IntSet> procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureSuperTypes;
SuperTypes entry = (SuperTypes)cache.getOrCreateSuperTypes(r);
existing.clearResult(querySupport);
existing.setPending();
typeHierarchyMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerTypeHierarchy(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<IntSet> procedure) throws DatabaseException {
+ public static void runnerTypeHierarchy(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<IntSet> procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureTypeHierarchy;
TypeHierarchy entry = (TypeHierarchy)cache.getOrCreateTypeHierarchy(r);
existing.clearResult(querySupport);
existing.setPending();
superRelationsMap.put(keyR(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerSuperRelations(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<IntSet> procedure) throws DatabaseException {
+ public static void runnerSuperRelations(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, InternalProcedure<IntSet> procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureSuperRelations;
SuperRelations entry = (SuperRelations)cache.getOrCreateSuperRelations(r);
}
}
- AsyncReadEntry getOrCreateAsyncReadEntry(AsyncRead<?> r) throws DatabaseException {
- AsyncReadEntry existing = null;
- synchronized(asyncReadEntryMap) {
- existing = (AsyncReadEntry)asyncReadEntryMap.get(r);
- if(existing == null) {
- existing = new AsyncReadEntry(r);
- existing.clearResult(querySupport);
- existing.setPending();
- asyncReadEntryMap.put(id(r), existing);
- return existing;
- }
- if(existing.requiresComputation()) {
- existing.setPending();
- return existing;
- }
- }
- if(existing.isPending()) waitPending(existing);
- return existing;
- }
-
- void remove(AsyncReadEntry entry) {
- synchronized(asyncReadEntryMap) {
- asyncReadEntryMap.remove(entry.request);
- }
- }
-
- static void runnerAsyncReadEntry(ReadGraphImpl graph, AsyncRead<?> r, CacheEntry parent, ListenerBase listener, AsyncProcedure procedure) throws DatabaseException {
- QueryCache cache = graph.processor.cache;
- if(procedure == null) procedure = emptyProcedureAsyncReadEntry;
- AsyncReadEntry entry = (AsyncReadEntry)cache.getOrCreateAsyncReadEntry(r);
- ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure, false);
- if(entry.isReady()) entry.performFromCache(graph, procedure);
- else {
- entry.compute(graph, procedure);
- if(listenerEntry != null) cache.primeListenerEntry(listenerEntry, entry.getResult());
- }
- }
-
MultiReadEntry getOrCreateMultiReadEntry(MultiRead<?> r) throws DatabaseException {
MultiReadEntry existing = null;
synchronized(multiReadEntryMap) {
existing.clearResult(querySupport);
existing.setPending();
multiReadEntryMap.put(id(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerMultiReadEntry(ReadGraphImpl graph, MultiRead<?> r, CacheEntry parent, ListenerBase listener, AsyncMultiProcedure procedure) throws DatabaseException {
+ public static void runnerMultiReadEntry(ReadGraphImpl graph, MultiRead<?> r, CacheEntry parent, ListenerBase listener, AsyncMultiProcedure procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureMultiReadEntry;
MultiReadEntry entry = (MultiReadEntry)cache.getOrCreateMultiReadEntry(r);
existing.clearResult(querySupport);
existing.setPending();
asyncMultiReadEntryMap.put(id(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerAsyncMultiReadEntry(ReadGraphImpl graph, AsyncMultiRead<?> r, CacheEntry parent, ListenerBase listener, AsyncMultiProcedure procedure) throws DatabaseException {
+ public static void runnerAsyncMultiReadEntry(ReadGraphImpl graph, AsyncMultiRead<?> r, CacheEntry parent, ListenerBase listener, AsyncMultiProcedure procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureAsyncMultiReadEntry;
AsyncMultiReadEntry entry = (AsyncMultiReadEntry)cache.getOrCreateAsyncMultiReadEntry(r);
existing.clearResult(querySupport);
existing.setPending();
externalReadEntryMap.put(id(r), existing);
+ size++;
return existing;
}
if(existing.requiresComputation()) {
}
}
- static void runnerExternalReadEntry(ReadGraphImpl graph, ExternalRead<?> r, CacheEntry parent, ListenerBase listener, AsyncProcedure procedure) throws DatabaseException {
+ public static void runnerExternalReadEntry(ReadGraphImpl graph, ExternalRead<?> r, CacheEntry parent, ListenerBase listener, AsyncProcedure procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
if(procedure == null) procedure = emptyProcedureExternalReadEntry;
ExternalReadEntry entry = (ExternalReadEntry)cache.getOrCreateExternalReadEntry(r);