X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2Fquery%2FExternalReadEntry.java;fp=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2Fquery%2FExternalReadEntry.java;h=556d5fc3e12b8d2df0d5e42ea2efb2221a8fb65f;hp=ac07ad7eda1acb4e3f51884b35b4b5ff99ad8445;hb=77ba75dcaf7d7c16187907f0661916d48e99edf6;hpb=ab7918e4c6dc68b4561fdfe4aa5fd93bf036ad58 diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ExternalReadEntry.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ExternalReadEntry.java index ac07ad7ed..556d5fc3e 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ExternalReadEntry.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ExternalReadEntry.java @@ -27,18 +27,18 @@ final public class ExternalReadEntry extends CacheEntryBase final LinkedList items = new LinkedList(); - protected ExternalRead request; + protected ExternalRead id; protected ReadGraphImpl graph; protected boolean registered = false; @Override int makeHash() { - return request.hashCode(); + return id.hashCode(); } @Override public Object getOriginalRequest() { - return request; + return id; } @Override @@ -47,14 +47,14 @@ final public class ExternalReadEntry extends CacheEntryBase @Override public void discard() { - request.unregistered(); - request = null; + id.unregistered(); + id = null; graph = null; super.discard(); } @Override - public void setPending() { + public void setPending(QuerySupport querySupport) { //if(result != NO_RESULT) { //new Exception("result = " + result).printStackTrace(); //} @@ -64,7 +64,7 @@ final public class ExternalReadEntry extends CacheEntryBase public ExternalReadEntry(ExternalRead request, ReadGraphImpl graph) { assert request != null; - this.request = request; + this.id = request; this.graph = graph; } @@ -119,7 +119,7 @@ final public class ExternalReadEntry extends CacheEntryBase } // Reschedule if(!items.isEmpty()) { - graph.processor.updatePrimitive(request); + graph.processor.updatePrimitive(id); } } @@ -138,8 +138,8 @@ final public class ExternalReadEntry extends CacheEntryBase @Override public String toString() { - if(request == null) return "DISCARDED ExternalRead"; - else return request.toString(); + if(id == null) return "DISCARDED ExternalRead"; + else return id.toString(); } }; @@ -148,8 +148,8 @@ final public class ExternalReadEntry extends CacheEntryBase @Override public String toString() { - if(request == null) return "DISCARDED ExternalRead " + System.identityHashCode(this); - else return request.toString() + " " + + System.identityHashCode(this); + if(id == null) return "DISCARDED ExternalRead " + System.identityHashCode(this); + else return id.toString() + " " + + System.identityHashCode(this); } @Override @@ -183,11 +183,11 @@ final public class ExternalReadEntry extends CacheEntryBase ReadGraphImpl queryGraph = graph.withParent(this); if(!registered) { - request.register(graph, this); + id.register(graph, this); registered = true; } - queryGraph.asyncBarrier.waitBarrier(request, graph); + queryGraph.asyncBarrier.waitBarrier(id, graph); } catch (Throwable t) { @@ -213,7 +213,7 @@ final public class ExternalReadEntry extends CacheEntryBase synchronized(items) { items.addLast(result); - graph.processor.updatePrimitive(request); + graph.processor.updatePrimitive(id); // TODO: implement flags/logic in ExternalRead to state that all but the latest request result can be evaporated // In some cases where data is produced really fast this might be necessary but currently this queueing will do. }