-
- final static AssertedStatements runner(ReadGraphImpl graph, final int r1, final int r2, final QueryProcessor provider, final AssertedStatements cached, final CacheEntry parent, final ListenerBase listener, final TripleIntProcedure procedure) {
-
- AssertedStatements entry = cached != null ? cached : (AssertedStatements)provider.assertedStatementsMap.get(id(r1,r2));
- if(entry == null) {
-
- entry = new AssertedStatements(r1, r2);
- entry.setPending();
- entry.clearResult(provider.querySupport);
- entry.putEntry(provider);
-
- provider.performForEach(graph, entry, parent, listener, procedure);
-
- return entry;
-
- } else {
-
- if(entry.isPending()) {
- synchronized(entry) {
- if(entry.isPending()) {
- throw new IllegalStateException();
-// if(entry.procs == null) entry.procs = new ArrayList<TripleIntProcedure>();
-// entry.procs.add(procedure);
-// provider.registerDependencies(graph, entry, parent, listener, procedure, false);
-// return entry;
- }
- }
- }
- provider.performForEach(graph, entry, parent, listener, procedure);
- }
-
- return entry;
-
- }
-
- final public static AssertedStatements queryEach(ReadGraphImpl graph, final int r1, final int r2, final QueryProcessor provider, final CacheEntry parent, final ListenerBase listener, final TripleIntProcedure procedure) {
-
- assert(r1 != 0);
- assert(r2 != 0);
-
- final AssertedStatements entry = (AssertedStatements)provider.assertedStatementsMap.get(id(r1,r2));
-
- if(parent == null && !(listener != null)) {
- if(entry != null && entry.isReady()) {
- entry.performFromCache(graph, provider, procedure);
- return entry;
- }
- }
-
- return runner(graph, r1, r2, provider, entry, parent, listener, procedure);
-
- }
-
- @Override
- public BinaryQuery<TripleIntProcedure> getEntry(QueryProcessor provider) {
- return provider.assertedStatementsMap.get(id);
- }
-
- @Override
- public void putEntry(QueryProcessor provider) {
- provider.assertedStatementsMap.put(id, this);
- }