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

Method addHelp

recipes/java-recipes/MicroMulti.java:48–60  ·  view source on GitHub ↗
(TransactionContext tcx, final byte[] key, final long amount)

Source from the content-addressed store, hash-verified

46 // TODO These two methods (addHelp and getLong) are used by the methods
47 // that are definitely in the book.
48 private static void addHelp(TransactionContext tcx, final byte[] key, final long amount){
49 tcx.run(new Function<Transaction,Void>() {
50 public Void apply(Transaction tr){
51 ByteBuffer b = ByteBuffer.allocate(8);
52 b.order(ByteOrder.LITTLE_ENDIAN);
53 b.putLong(amount);
54
55 tr.mutate(MutationType.ADD, key, b.array());
56
57 return null;
58 }
59 });
60 }
61
62 private static long getLong(byte[] val){
63 ByteBuffer b = ByteBuffer.allocate(8);

Callers 1

applyMethod · 0.95

Calls 1

runMethod · 0.65

Tested by

no test coverage detected