return processor.getSession();
}
-// @Override
-// final public Builtins getBuiltins() {
-// return processor.getSession().getBuiltins();
-// }
-
@Override
public <T> void asyncRequest(final Read<T> request) {
return new ReadGraphImpl(null, support);
}
- public static ReadGraphImpl forRecompute(CacheEntry entry, QueryProcessor support) {
- return new ReadGraphImpl(entry, support);
- }
-
@Override
public <T> void asyncRequest(Read<T> request, SyncProcedure<T> procedure) {
asyncRequest(request, new SyncToAsyncProcedure<T>(procedure));
return thread == Integer.MIN_VALUE;
}
-// final private boolean isSync(int thread) {
-// return thread < -1 && thread > Integer.MIN_VALUE;
-// }
-
ReadGraphImpl(ReadGraphImpl graph) {
this(graph.parent, graph.processor);
}
ReadGraphImpl(CacheEntry parent, QueryProcessor support) {
-// this.state = new ReadGraphState(barrier, support);
this.parent = parent;
this.processor = support;
}
- ReadGraphImpl(final QueryProcessor support) {
-
-// this.state = state;
- this.processor = support;
- this.parent = null;
-
- }
-
-// public static ReadGraphImpl createSync(int syncThread, Object syncParent,
-// ReadGraphSupportImpl support) {
-// return new ReadGraphImpl(syncThread, syncThread, syncParent, null,
-// support, new AsyncBarrierImpl(null));
-// }
-
public static ReadGraphImpl create(QueryProcessor support) {
- return new ReadGraphImpl(support);
- }
-
-// public ReadGraphImpl newAsync() {
-// return this;
-//// if(!state.synchronizedExecution) {
-//// return this;
-//// } else {
-//// return new ReadGraphImpl(false, parent, state.support, state.barrier);
-//// }
-// }
-
-// public ReadGraphImpl newSync() {
-// return new ReadGraphImpl(parent, processor);
-// }
-
- public ReadGraphImpl newSync(CacheEntry parentEntry) {
- return new ReadGraphImpl(parentEntry, processor);
+ return new ReadGraphImpl(null, support);
}
public ReadGraphImpl newRestart(ReadGraphImpl impl) {
WriteGraphImpl write = processor.getSession().getService(
WriteGraphImpl.class);
-// if (write.callerThread != impl.callerThread)
-// return new WriteGraphImpl(impl.callerThread, parent, state.support, write.writeSupport, write.provider, write.state.barrier);
return write;
}
-// public ReadGraphImpl newSync(Object parentRequest) {
-// return new ReadGraphImpl(callerThread, state.parent, state.support, new AsyncBarrierImpl(state.barrier));
-// }
-
-// public ReadGraphImpl newSync(final int callerThread, Object parentRequest) {
-// assert (state.syncThread == callerThread || (state.syncThread == Integer.MIN_VALUE && callerThread != Integer.MIN_VALUE));
-// return new ReadGraphImpl(callerThread, callerThread, parentRequest,
-// state.parent, state.support, new AsyncBarrierImpl(state.barrier));
-// }
-//
-// public ReadGraphImpl newSyncAsync(Object parentRequest) {
-//// assert (callerThread < 0);
-// return new ReadGraphImpl(callerThread, state.syncThread, parentRequest,
-// state.parent, state.support, new AsyncBarrierImpl(state.barrier));
-// }
-//
-// public ReadGraphImpl newSyncAsync(final int callerThread,
-// Object parentRequest) {
-//// assert (callerThread < 0);
-// // assert(state.syncThread == callerThread || (state.syncThread == Integer.MIN_VALUE
-// // && callerThread != Integer.MIN_VALUE) );
-// return new ReadGraphImpl(callerThread, callerThread, parentRequest,
-// state.parent, state.support, new AsyncBarrierImpl(state.barrier));
-// }
-
- public ReadGraphImpl withAsyncParent(CacheEntry parent) {
- return new ReadGraphImpl(parent, processor);
- }
-
public ReadGraphImpl withParent(CacheEntry parent) {
if(parent == this.parent) return this;
else return new ReadGraphImpl(parent, processor);
assert(procedure.done());
-// while (!procedure.done()) {
-//
-// boolean executed = processor.resumeTasks(callerThread, null, null);
-// if (!executed) {
-// try {
-// Thread.sleep(1);
-// // sema.tryAcquire(1, TimeUnit.MILLISECONDS);
-// } catch (InterruptedException e) {
-// e.printStackTrace();
-// }
-// }
-//
-// }
-
}
public <T> void waitAsyncProcedure(AsyncReadProcedure<T> procedure) {
assert(procedure.done());
-// while (!procedure.done()) {
-//
-// boolean executed = processor.processor.resume(this);
-// if (!executed) {
-// try {
-// Thread.sleep(1);
-// // sema.tryAcquire(1, TimeUnit.MILLISECONDS);
-// } catch (InterruptedException e) {
-// e.printStackTrace();
-// }
-// }
-//
-// }
-
}
-
-// public void waitAsync(Object request) {
-// try {
-// state.barrier.waitBarrier(request, this);
-// } catch (Throwable t) {
-// t.printStackTrace();
-// processor.scanPending();
-// processor.querySupport.checkTasks();
-// throw new RuntimeDatabaseException(t);
-// }
-// }
-
-// public void restart() {
-// state.barrier.restart();
-// }
public boolean resumeTasks() {
return processor.resumeTasks(this);
super(querySupport, threads);
}
- Objects getOrCreateObjects(ReadGraphImpl graph, int r1, int r2) throws DatabaseException {
+ Objects getOrCreateObjects(QueryProcessor processor, int r1, int r2) throws DatabaseException {
Objects existing = null;
synchronized(objectsMap) {
existing = (Objects)objectsMap.get(r1,r2);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
Objects.computeForEach(graph, r1,r2, null, procedure);
return;
}
- Objects entry = (Objects)cache.getOrCreateObjects(graph, r1,r2);
+ Objects entry = (Objects)cache.getOrCreateObjects(graph.processor, r1,r2);
IntProcedure procedure_ = procedure != null ? procedure : emptyProcedureObjects;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- Statements getOrCreateStatements(ReadGraphImpl graph, int r1, int r2) throws DatabaseException {
+ Statements getOrCreateStatements(QueryProcessor processor, int r1, int r2) throws DatabaseException {
Statements existing = null;
synchronized(statementsMap) {
existing = (Statements)statementsMap.get(r1,r2);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
Statements.computeForEach(graph, r1,r2, null, procedure);
return;
}
- Statements entry = (Statements)cache.getOrCreateStatements(graph, r1,r2);
+ Statements entry = (Statements)cache.getOrCreateStatements(graph.processor, r1,r2);
TripleIntProcedure procedure_ = procedure != null ? procedure : emptyProcedureStatements;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- DirectObjects getOrCreateDirectObjects(ReadGraphImpl graph, int r1, int r2) throws DatabaseException {
+ DirectObjects getOrCreateDirectObjects(QueryProcessor processor, int r1, int r2) throws DatabaseException {
DirectObjects existing = null;
synchronized(directObjectsMap) {
existing = (DirectObjects)directObjectsMap.get(r1,r2);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
DirectObjects.computeForEach(graph, r1,r2, null, procedure);
return;
}
- DirectObjects entry = (DirectObjects)cache.getOrCreateDirectObjects(graph, r1,r2);
+ DirectObjects entry = (DirectObjects)cache.getOrCreateDirectObjects(graph.processor, r1,r2);
IntProcedure procedure_ = procedure != null ? procedure : emptyProcedureDirectObjects;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- RelationInfoQuery getOrCreateRelationInfoQuery(ReadGraphImpl graph, int r) throws DatabaseException {
+ RelationInfoQuery getOrCreateRelationInfoQuery(QueryProcessor processor, int r) throws DatabaseException {
RelationInfoQuery existing = null;
synchronized(relationInfoQueryMap) {
existing = (RelationInfoQuery)relationInfoQueryMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
RelationInfoQuery.computeForEach(graph, r, null, procedure);
return;
}
- RelationInfoQuery entry = (RelationInfoQuery)cache.getOrCreateRelationInfoQuery(graph, r);
+ RelationInfoQuery entry = (RelationInfoQuery)cache.getOrCreateRelationInfoQuery(graph.processor, r);
InternalProcedure<RelationInfo> procedure_ = procedure != null ? procedure : emptyProcedureRelationInfoQuery;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- URIToResource getOrCreateURIToResource(ReadGraphImpl graph, String id) throws DatabaseException {
+ URIToResource getOrCreateURIToResource(QueryProcessor processor, String id) throws DatabaseException {
URIToResource existing = null;
synchronized(uRIToResourceMap) {
existing = (URIToResource)uRIToResourceMap.get(id);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
URIToResource.computeForEach(graph, id, null, procedure);
return;
}
- URIToResource entry = (URIToResource)cache.getOrCreateURIToResource(graph, id);
+ URIToResource entry = (URIToResource)cache.getOrCreateURIToResource(graph.processor, id);
InternalProcedure<Integer> procedure_ = procedure != null ? procedure : emptyProcedureURIToResource;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- ValueQuery getOrCreateValueQuery(ReadGraphImpl graph, int r) throws DatabaseException {
+ ValueQuery getOrCreateValueQuery(QueryProcessor processor, int r) throws DatabaseException {
ValueQuery existing = null;
synchronized(valueQueryMap) {
existing = (ValueQuery)valueQueryMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
ValueQuery.computeForEach(graph, r, null, procedure);
return;
}
- ValueQuery entry = (ValueQuery)cache.getOrCreateValueQuery(graph, r);
+ ValueQuery entry = (ValueQuery)cache.getOrCreateValueQuery(graph.processor, r);
InternalProcedure<byte[]> procedure_ = procedure != null ? procedure : emptyProcedureValueQuery;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- OrderedSet getOrCreateOrderedSet(ReadGraphImpl graph, int r) throws DatabaseException {
+ OrderedSet getOrCreateOrderedSet(QueryProcessor processor, int r) throws DatabaseException {
OrderedSet existing = null;
synchronized(orderedSetMap) {
existing = (OrderedSet)orderedSetMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
OrderedSet.computeForEach(graph, r, null, procedure);
return;
}
- OrderedSet entry = (OrderedSet)cache.getOrCreateOrderedSet(graph, r);
+ OrderedSet entry = (OrderedSet)cache.getOrCreateOrderedSet(graph.processor, r);
IntProcedure procedure_ = procedure != null ? procedure : emptyProcedureOrderedSet;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- PrincipalTypes getOrCreatePrincipalTypes(ReadGraphImpl graph, int r) throws DatabaseException {
+ PrincipalTypes getOrCreatePrincipalTypes(QueryProcessor processor, int r) throws DatabaseException {
PrincipalTypes existing = null;
synchronized(principalTypesMap) {
existing = (PrincipalTypes)principalTypesMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
PrincipalTypes.computeForEach(graph, r, null, procedure);
return;
}
- PrincipalTypes entry = (PrincipalTypes)cache.getOrCreatePrincipalTypes(graph, r);
+ PrincipalTypes entry = (PrincipalTypes)cache.getOrCreatePrincipalTypes(graph.processor, r);
IntProcedure procedure_ = procedure != null ? procedure : emptyProcedurePrincipalTypes;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- DirectPredicates getOrCreateDirectPredicates(ReadGraphImpl graph, int r) throws DatabaseException {
+ DirectPredicates getOrCreateDirectPredicates(QueryProcessor processor, int r) throws DatabaseException {
DirectPredicates existing = null;
synchronized(directPredicatesMap) {
existing = (DirectPredicates)directPredicatesMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
DirectPredicates.computeForEach(graph, r, null, procedure);
return;
}
- DirectPredicates entry = (DirectPredicates)cache.getOrCreateDirectPredicates(graph, r);
+ DirectPredicates entry = (DirectPredicates)cache.getOrCreateDirectPredicates(graph.processor, r);
InternalProcedure<IntSet> procedure_ = procedure != null ? procedure : emptyProcedureDirectPredicates;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- Predicates getOrCreatePredicates(ReadGraphImpl graph, int r) throws DatabaseException {
+ Predicates getOrCreatePredicates(QueryProcessor processor, int r) throws DatabaseException {
Predicates existing = null;
synchronized(predicatesMap) {
existing = (Predicates)predicatesMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
Predicates.computeForEach(graph, r, null, procedure);
return;
}
- Predicates entry = (Predicates)cache.getOrCreatePredicates(graph, r);
+ Predicates entry = (Predicates)cache.getOrCreatePredicates(graph.processor, r);
InternalProcedure<IntSet> procedure_ = procedure != null ? procedure : emptyProcedurePredicates;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- ReadEntry getOrCreateReadEntry(ReadGraphImpl graph, Read<?> r, boolean isSync) throws DatabaseException {
+ ReadEntry getOrCreateReadEntry(QueryProcessor processor, Read<?> r, boolean isSync) throws DatabaseException {
ReadEntry existing = null;
synchronized(readEntryMap) {
existing = (ReadEntry)readEntryMap.get(r);
}
}
if(existing.isPending()) {
- if(isSync) waitPending(graph, existing);
+ if(isSync) waitPending(processor, existing);
else return null;
}
return existing;
ReadEntry.computeForEach(graph, r, null, procedure);
return;
}
- ReadEntry entry = (ReadEntry)cache.getOrCreateReadEntry(graph, r, isSync);
+ ReadEntry entry = (ReadEntry)cache.getOrCreateReadEntry(graph.processor, r, isSync);
if(entry == null) {
graph.processor.schedule(new SessionTask(false) {
@Override
}
}
- AsyncReadEntry getOrCreateAsyncReadEntry(ReadGraphImpl graph, AsyncRead<?> r, boolean isSync) throws DatabaseException {
+ AsyncReadEntry getOrCreateAsyncReadEntry(QueryProcessor processor, AsyncRead<?> r, boolean isSync) throws DatabaseException {
AsyncReadEntry existing = null;
synchronized(asyncReadEntryMap) {
existing = (AsyncReadEntry)asyncReadEntryMap.get(r);
}
}
if(existing.isPending()) {
- if(isSync) waitPending(graph, existing);
+ if(isSync) waitPending(processor, existing);
else return null;
}
return existing;
AsyncReadEntry.computeForEach(graph, r, null, procedure);
return;
}
- AsyncReadEntry entry = (AsyncReadEntry)cache.getOrCreateAsyncReadEntry(graph, r, isSync);
+ AsyncReadEntry entry = (AsyncReadEntry)cache.getOrCreateAsyncReadEntry(graph.processor, r, isSync);
if(entry == null) {
graph.processor.schedule(new SessionTask(false) {
@Override
}
}
- Types getOrCreateTypes(ReadGraphImpl graph, int r) throws DatabaseException {
+ Types getOrCreateTypes(QueryProcessor processor, int r) throws DatabaseException {
Types existing = null;
synchronized(typesMap) {
existing = (Types)typesMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
Types.computeForEach(graph, r, null, procedure);
return;
}
- Types entry = (Types)cache.getOrCreateTypes(graph, r);
+ Types entry = (Types)cache.getOrCreateTypes(graph.processor, r);
InternalProcedure<IntSet> procedure_ = procedure != null ? procedure : emptyProcedureTypes;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- ChildMap getOrCreateChildMap(ReadGraphImpl graph, int r) throws DatabaseException {
+ ChildMap getOrCreateChildMap(QueryProcessor processor, int r) throws DatabaseException {
ChildMap existing = null;
synchronized(childMapMap) {
existing = (ChildMap)childMapMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
ChildMap.computeForEach(graph, r, null, procedure);
return;
}
- ChildMap entry = (ChildMap)cache.getOrCreateChildMap(graph, r);
+ ChildMap entry = (ChildMap)cache.getOrCreateChildMap(graph.processor, r);
InternalProcedure<ObjectResourceIdMap<String>> procedure_ = procedure != null ? procedure : emptyProcedureChildMap;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- AssertedStatements getOrCreateAssertedStatements(ReadGraphImpl graph, int r1, int r2) throws DatabaseException {
+ AssertedStatements getOrCreateAssertedStatements(QueryProcessor processor, int r1, int r2) throws DatabaseException {
AssertedStatements existing = null;
synchronized(assertedStatementsMap) {
existing = (AssertedStatements)assertedStatementsMap.get(r1,r2);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
public static void runnerAssertedStatements(ReadGraphImpl graph, int r1, int r2, CacheEntry parent, ListenerBase listener, final TripleIntProcedure procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
- AssertedStatements entry = (AssertedStatements)cache.getOrCreateAssertedStatements(graph, r1,r2);
+ AssertedStatements entry = (AssertedStatements)cache.getOrCreateAssertedStatements(graph.processor, r1,r2);
TripleIntProcedure procedure_ = procedure != null ? procedure : emptyProcedureAssertedStatements;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- AssertedPredicates getOrCreateAssertedPredicates(ReadGraphImpl graph, int r) throws DatabaseException {
+ AssertedPredicates getOrCreateAssertedPredicates(QueryProcessor processor, int r) throws DatabaseException {
AssertedPredicates existing = null;
synchronized(assertedPredicatesMap) {
existing = (AssertedPredicates)assertedPredicatesMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
public static void runnerAssertedPredicates(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, final IntProcedure procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
- AssertedPredicates entry = (AssertedPredicates)cache.getOrCreateAssertedPredicates(graph, r);
+ AssertedPredicates entry = (AssertedPredicates)cache.getOrCreateAssertedPredicates(graph.processor, r);
IntProcedure procedure_ = procedure != null ? procedure : emptyProcedureAssertedPredicates;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- DirectSuperRelations getOrCreateDirectSuperRelations(ReadGraphImpl graph, int r) throws DatabaseException {
+ DirectSuperRelations getOrCreateDirectSuperRelations(QueryProcessor processor, int r) throws DatabaseException {
DirectSuperRelations existing = null;
synchronized(directSuperRelationsMap) {
existing = (DirectSuperRelations)directSuperRelationsMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
public static void runnerDirectSuperRelations(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, final IntProcedure procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
- DirectSuperRelations entry = (DirectSuperRelations)cache.getOrCreateDirectSuperRelations(graph, r);
+ DirectSuperRelations entry = (DirectSuperRelations)cache.getOrCreateDirectSuperRelations(graph.processor, r);
IntProcedure procedure_ = procedure != null ? procedure : emptyProcedureDirectSuperRelations;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- SuperTypes getOrCreateSuperTypes(ReadGraphImpl graph, int r) throws DatabaseException {
+ SuperTypes getOrCreateSuperTypes(QueryProcessor processor, int r) throws DatabaseException {
SuperTypes existing = null;
synchronized(superTypesMap) {
existing = (SuperTypes)superTypesMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
public static void runnerSuperTypes(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, final InternalProcedure<IntSet> procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
- SuperTypes entry = (SuperTypes)cache.getOrCreateSuperTypes(graph, r);
+ SuperTypes entry = (SuperTypes)cache.getOrCreateSuperTypes(graph.processor, r);
InternalProcedure<IntSet> procedure_ = procedure != null ? procedure : emptyProcedureSuperTypes;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- TypeHierarchy getOrCreateTypeHierarchy(ReadGraphImpl graph, int r) throws DatabaseException {
+ TypeHierarchy getOrCreateTypeHierarchy(QueryProcessor processor, int r) throws DatabaseException {
TypeHierarchy existing = null;
synchronized(typeHierarchyMap) {
existing = (TypeHierarchy)typeHierarchyMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
public static void runnerTypeHierarchy(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, final InternalProcedure<IntSet> procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
- TypeHierarchy entry = (TypeHierarchy)cache.getOrCreateTypeHierarchy(graph, r);
+ TypeHierarchy entry = (TypeHierarchy)cache.getOrCreateTypeHierarchy(graph.processor, r);
InternalProcedure<IntSet> procedure_ = procedure != null ? procedure : emptyProcedureTypeHierarchy;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- SuperRelations getOrCreateSuperRelations(ReadGraphImpl graph, int r) throws DatabaseException {
+ SuperRelations getOrCreateSuperRelations(QueryProcessor processor, int r) throws DatabaseException {
SuperRelations existing = null;
synchronized(superRelationsMap) {
existing = (SuperRelations)superRelationsMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
public static void runnerSuperRelations(ReadGraphImpl graph, int r, CacheEntry parent, ListenerBase listener, final InternalProcedure<IntSet> procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
- SuperRelations entry = (SuperRelations)cache.getOrCreateSuperRelations(graph, r);
+ SuperRelations entry = (SuperRelations)cache.getOrCreateSuperRelations(graph.processor, r);
InternalProcedure<IntSet> procedure_ = procedure != null ? procedure : emptyProcedureSuperRelations;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- MultiReadEntry getOrCreateMultiReadEntry(ReadGraphImpl graph, MultiRead<?> r) throws DatabaseException {
+ MultiReadEntry getOrCreateMultiReadEntry(QueryProcessor processor, MultiRead<?> r) throws DatabaseException {
MultiReadEntry existing = null;
synchronized(multiReadEntryMap) {
existing = (MultiReadEntry)multiReadEntryMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
public static void runnerMultiReadEntry(ReadGraphImpl graph, MultiRead<?> r, CacheEntry parent, ListenerBase listener, final AsyncMultiProcedure procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
- MultiReadEntry entry = (MultiReadEntry)cache.getOrCreateMultiReadEntry(graph, r);
+ MultiReadEntry entry = (MultiReadEntry)cache.getOrCreateMultiReadEntry(graph.processor, r);
AsyncMultiProcedure procedure_ = procedure != null ? procedure : emptyProcedureMultiReadEntry;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- AsyncMultiReadEntry getOrCreateAsyncMultiReadEntry(ReadGraphImpl graph, AsyncMultiRead<?> r) throws DatabaseException {
+ AsyncMultiReadEntry getOrCreateAsyncMultiReadEntry(QueryProcessor processor, AsyncMultiRead<?> r) throws DatabaseException {
AsyncMultiReadEntry existing = null;
synchronized(asyncMultiReadEntryMap) {
existing = (AsyncMultiReadEntry)asyncMultiReadEntryMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
public static void runnerAsyncMultiReadEntry(ReadGraphImpl graph, AsyncMultiRead<?> r, CacheEntry parent, ListenerBase listener, final AsyncMultiProcedure procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
- AsyncMultiReadEntry entry = (AsyncMultiReadEntry)cache.getOrCreateAsyncMultiReadEntry(graph, r);
+ AsyncMultiReadEntry entry = (AsyncMultiReadEntry)cache.getOrCreateAsyncMultiReadEntry(graph.processor, r);
AsyncMultiProcedure procedure_ = procedure != null ? procedure : emptyProcedureAsyncMultiReadEntry;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);
}
}
- ExternalReadEntry getOrCreateExternalReadEntry(ReadGraphImpl graph, ExternalRead<?> r) throws DatabaseException {
+ ExternalReadEntry getOrCreateExternalReadEntry(QueryProcessor processor, ExternalRead<?> r) throws DatabaseException {
ExternalReadEntry existing = null;
synchronized(externalReadEntryMap) {
existing = (ExternalReadEntry)externalReadEntryMap.get(r);
return existing;
}
}
- if(existing.isPending()) waitPending(graph, existing);
+ if(existing.isPending()) waitPending(processor, existing);
return existing;
}
public static void runnerExternalReadEntry(ReadGraphImpl graph, ExternalRead<?> r, CacheEntry parent, ListenerBase listener, final AsyncProcedure procedure) throws DatabaseException {
QueryCache cache = graph.processor.cache;
- ExternalReadEntry entry = (ExternalReadEntry)cache.getOrCreateExternalReadEntry(graph, r);
+ ExternalReadEntry entry = (ExternalReadEntry)cache.getOrCreateExternalReadEntry(graph.processor, r);
AsyncProcedure procedure_ = procedure != null ? procedure : emptyProcedureExternalReadEntry;
ListenerEntry listenerEntry = cache.registerDependencies(graph, entry, parent, listener, procedure_, false);
if(entry.isReady()) entry.performFromCache(graph, procedure_);