]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/Objects.java
Multiple readers and variable optimization
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / query / Objects.java
index d95f3160a6774a53dc566a1b1d15054224b1a93d..62fb3bdb8c73c3449b091501d7d275264ab6a889 100644 (file)
@@ -81,7 +81,7 @@ final public class Objects extends CollectionBinaryQuery<IntProcedure> {
                        @Override
                        public void execute(ReadGraphImpl graph, int type) throws DatabaseException {
                                if(result == null) {
-                                       result = QueryCacheBase.resultAssertedStatements(graph, type, r2, entry, null, NOPT);
+                                       result = QueryCacheBase.resultAssertedStatements(graph, type, r2, entry, null);
                                } else {
                                        if (first) {
                                                IntArray ia = result;
@@ -91,7 +91,7 @@ final public class Objects extends CollectionBinaryQuery<IntProcedure> {
                                                }
                                                first = false;
                                        }
-                                       IntArray ia = QueryCacheBase.resultAssertedStatements(graph, type, r2, entry, null, NOPT);
+                                       IntArray ia = QueryCacheBase.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]);
                                        }
@@ -151,7 +151,7 @@ final public class Objects extends CollectionBinaryQuery<IntProcedure> {
 
                        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);
@@ -173,7 +173,7 @@ final public class Objects extends CollectionBinaryQuery<IntProcedure> {
 
                                                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);
@@ -312,7 +312,7 @@ final public class Objects extends CollectionBinaryQuery<IntProcedure> {
                } 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() {
 
                                boolean found = false;
@@ -544,7 +544,7 @@ final public class Objects extends CollectionBinaryQuery<IntProcedure> {
                } 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
@@ -656,7 +656,7 @@ final public class Objects extends CollectionBinaryQuery<IntProcedure> {
 
        public static void computeForEach(ReadGraphImpl graph, final int r1, final int r2, final Objects entry, final IntProcedure procedure) throws DatabaseException {
 
-               RelationInfo ri = QueryCache.resultRelationInfoQuery(graph, r2, entry, null, ip);
+               RelationInfo ri = QueryCache.resultRelationInfoQuery(graph, r2, entry, null);
                graph.ensureLoaded(r1, r2);       
                if(ri.isFunctional) {
                        computeFunctionalIndex(graph, r1, r2, entry, ri, procedure);
@@ -666,18 +666,6 @@ final public class Objects extends CollectionBinaryQuery<IntProcedure> {
 
        }
 
-       final static InternalProcedure<RelationInfo> ip = new InternalProcedure<RelationInfo>() {
-
-               @Override
-               public void execute(ReadGraphImpl graph, RelationInfo result) {
-               }
-
-               @Override
-               public void exception(ReadGraphImpl graph, Throwable throwable) {
-               }
-
-       };
-
        @Override
        public String toString() {
                return "Objects[" + r1() + " - " + r2() + "]";