- Set<Variable> nodes = graph.syncRequest(new NodesRequest(variable), TransientCacheAsyncListener.<Set<Variable>>instance());
- HashSet<JSONObject> rs = new HashSet<JSONObject>(); // result
- if(nodes.isEmpty()) {
- return Collections.emptyList();
- }
-
-
- /*TreeMap<String, Variable> nodeMap = new TreeMap<String, Variable>();
-
- for (Variable node : nodes) {
- nodeMap.put(node.getURI(graph), node);
- }
- System.out.println("*************************************************************************");
- for (Variable node : nodeMap.values()) {
- System.out.println(" " + node.getURI(graph));
- }*/
-
- for(Variable node : nodes) {
- rs.add(graph.syncRequest(new NodeRequest(node), TransientCacheAsyncListener.<JSONObject>instance()));
- }
+ long s = System.nanoTime();
+
+ Set<Variable> nodes = graph.syncRequest(new NodesRequest(variable), TransientCacheAsyncListener.<Set<Variable>>instance());
+ HashSet<JSONObject> rs = new HashSet<JSONObject>(); // result
+ if(nodes.isEmpty()) {
+ return Collections.emptyList();
+ }
+
+
+ /*TreeMap<String, Variable> nodeMap = new TreeMap<String, Variable>();
+
+ for (Variable node : nodes) {
+ nodeMap.put(node.getURI(graph), node);
+ }
+ System.out.println("*************************************************************************");
+ for (Variable node : nodeMap.values()) {
+ System.out.println(" " + node.getURI(graph));
+ }*/
+
+ Semaphore done = new Semaphore(0);
+
+ for(Variable node : nodes) {
+
+ graph.asyncRequest(new NodeRequestE(node), new Listener<JSONObject>() {