(TransactionContext tcx, final String node, final Subspace domain)
| 80 | } |
| 81 | |
| 82 | private static ArrayList<String> getNeighbors(TransactionContext tcx, final String node, final Subspace domain){ |
| 83 | return tcx.run(new Function<Transaction,ArrayList<String> >(){ |
| 84 | public ArrayList<String> apply(Transaction tr){ |
| 85 | ArrayList<String> neighbors = new ArrayList<String>(); |
| 86 | for(KeyValue kv : tr.getRange( |
| 87 | domain.subspace(Tuple.from(node)).range())){ |
| 88 | neighbors.add(domain.unpack(kv.getKey()).getString(1)); |
| 89 | } |
| 90 | return neighbors; |
| 91 | } |
| 92 | }); |
| 93 | } |
| 94 | |
| 95 | // TODO These next two methods contain code that is referenced |
| 96 | // in the extensions of graph, namely code to handle weighted graphs. |
no test coverage detected