@Override
public void execute(ReadGraphImpl graph, int type) throws DatabaseException {
if(result == null) {
- result = QueryCache.resultAssertedStatements(graph, type, r2, entry, null, NOPT);
+ result = QueryCache.resultAssertedStatements(graph, type, r2, entry, null);
} else {
if (first) {
IntArray ia = result;
}
first = false;
}
- IntArray ia = QueryCache.resultAssertedStatements(graph, type, r2, entry, null, NOPT);
+ IntArray ia = QueryCache.resultAssertedStatements(graph, type, r2, entry, null);
if(ia.data != null) {
for(int i = 0;i < ia.sizeOrData ; i+=3) addStatement(ia.data[i],ia.data[i+1],ia.data[i+2]);
}
final static private void forSingleAssertion(ReadGraphImpl graph, final int r1, final int r2, final Statements entry, final TripleIntProcedure procedure) throws DatabaseException {
+ if(entry != null) {
+ assert(entry.isPending());
+ }
+
IntArray map = getAssertionMap(graph, r1, r2, entry);
if(map == null) {
if(entry != null) entry.finish(graph, procedure);
IntSet candidateIs = null;
try {
- candidateIs = QueryCache.resultSuperTypes(graph, candidateS, entry, null, NOP);
+ candidateIs = QueryCache.resultSuperTypes(graph, candidateS, entry, null);
} catch (DatabaseException e) {
if(entry != null) entry.except(e);
procedure.exception(graph, e);
IntSet nextIs = null;
try {
- nextIs = QueryCache.resultSuperTypes(graph, nextS, entry, null, NOP);
+ nextIs = QueryCache.resultSuperTypes(graph, nextS, entry, null);
} catch (DatabaseException e) {
if(entry != null) entry.except(e);
procedure.exception(graph, e);
final AtomicBoolean found = new AtomicBoolean(false);
// Note! The dependency is intentionally cut!
- IntSet direct = QueryCache.resultDirectPredicates(graph, r1, null, null, QueryCache.emptyProcedureDirectPredicates);
+ IntSet direct = QueryCache.resultDirectPredicates(graph, r1, null, null);
direct.forEach(graph, new SyncIntProcedure() {
@Override
} else {
// Note! The dependency is intentionally cut!
- IntSet direct = QueryCache.resultDirectPredicates(graph, r1, null, null, QueryCache.emptyProcedureDirectPredicates);
+ IntSet direct = QueryCache.resultDirectPredicates(graph, r1, null, null);
direct.forEach(graph, new SyncIntProcedure() {
@Override
try {
- IntSet result = QueryCache.resultSuperRelations(graph, pred2, entry, null, null);
+ IntSet result = QueryCache.resultSuperRelations(graph, pred2, entry, null);
if(result.contains(r2)) {
inc();
}
}
-
- @Override
- public Object compute(ReadGraphImpl graph, final TripleIntProcedure procedure) throws DatabaseException {
- computeForEach(graph, r1(), r2(), this, procedure);
- return getResult();
- }
public static void computeForEach(ReadGraphImpl graph, final int r1, final int r2, final Statements entry, final TripleIntProcedure procedure) throws DatabaseException {
+ if(entry != null) {
+ assert(entry.isPending());
+ }
+
QueryCache.runnerRelationInfoQuery(graph, r2, entry, null, new InternalProcedure<RelationInfo>() {
@Override
synchronized(this) {
setReady();
+ //new Exception(toString() + " is READY").printStackTrace();
}
IntArray v = (IntArray)getResult();
@Override
public void recompute(ReadGraphImpl graph) throws DatabaseException {
- compute(graph, new TripleIntProcedureAdapter() {
+ computeForEach(graph, r1(), r2(), this, new TripleIntProcedureAdapter() {
@Override
public void finished(ReadGraphImpl graph) {