| 122 | } |
| 123 | |
| 124 | public static long getWeight(TransactionContext tcx, final String node, final String neighbor){ |
| 125 | return tcx.run(new Function<Transaction,Long>() { |
| 126 | public Long apply(Transaction tr){ |
| 127 | ByteBuffer b = ByteBuffer.allocate(8); |
| 128 | b.order(ByteOrder.LITTLE_ENDIAN); |
| 129 | b.put(tr.get(wEdge.pack(Tuple.from(node,neighbor))).get()); |
| 130 | return b.getLong(0); |
| 131 | } |
| 132 | }); |
| 133 | } |
| 134 | |
| 135 | |
| 136 | public static void setNeighborNeighbors(TransactionContext tcx, final String node, final String neighbor, final String neighborsNeighbor){ |