MCPcopy Create free account
hub / github.com/apple/foundationdb / getNeighbors

Method getNeighbors

recipes/java-recipes/MicroGraph.java:82–93  ·  view source on GitHub ↗
(TransactionContext tcx, final String node, final Subspace domain)

Source from the content-addressed store, hash-verified

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.

Callers 2

getOutNeighborsMethod · 0.95
getInNeighborsMethod · 0.95

Calls 1

runMethod · 0.65

Tested by

no test coverage detected