(Transaction tr)
| 74 | public static void setLocation(TransactionContext tcx, final String label, final long[] pos){ |
| 75 | tcx.run(new Function<Transaction,Void>() { |
| 76 | public Void apply(Transaction tr){ |
| 77 | long z = xyToZ(pos); |
| 78 | boolean isPrevious = false; |
| 79 | long previous = 0l; |
| 80 | |
| 81 | for(KeyValue kv : tr.getRange(labelZ.subspace(Tuple.from(label)).range(),1)){ |
| 82 | isPrevious = true; |
| 83 | previous = Tuple.fromBytes(kv.getKey()).getLong(2); |
| 84 | } |
| 85 | |
| 86 | if(isPrevious){ |
| 87 | tr.clear(labelZ.pack(Tuple.from(label,previous))); |
| 88 | tr.clear(zLabel.pack(Tuple.from(previous,label))); |
| 89 | } |
| 90 | tr.set(labelZ.pack(Tuple.from(label,z)),Tuple.from().pack()); |
| 91 | tr.set(zLabel.pack(Tuple.from(z,label)),Tuple.from().pack()); |
| 92 | return null; |
| 93 | } |
| 94 | }); |
| 95 | } |
| 96 |
nothing calls this directly
no test coverage detected