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

Method subtract

recipes/java-recipes/MicroMulti.java:81–96  ·  view source on GitHub ↗
(TransactionContext tcx, final String index,
								final Object value)

Source from the content-addressed store, hash-verified

79 }
80
81 public static void subtract(TransactionContext tcx, final String index,
82 final Object value){
83 tcx.run(new Function<Transaction,Void>() {
84 public Void apply(Transaction tr){
85 Future<byte[]> v = tr.get(multi.subspace(
86 Tuple.from(index,value)).getKey());
87
88 if(v.get() != null && getLong(v.get()) > 1l){
89 addHelp(tr, multi.subspace(Tuple.from(index,value)).getKey(), -1l);
90 } else {
91 tr.clear(multi.subspace(Tuple.from(index,value)).getKey());
92 }
93 return null;
94 }
95 });
96 }
97
98 public static ArrayList<Object> get(TransactionContext tcx, final String index){
99 return tcx.run(new Function<Transaction,ArrayList<Object> >() {

Callers 7

mainMethod · 0.95
TupleComparisonTestClass · 0.80
serializedFormsMethod · 0.80
processInstructionMethod · 0.80
processInstructionMethod · 0.80
encodeMethod · 0.80
decodeMethod · 0.80

Calls 1

runMethod · 0.65

Tested by 3

serializedFormsMethod · 0.64
processInstructionMethod · 0.64
processInstructionMethod · 0.64