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

Method setUser

recipes/java-recipes/MicroIndexes.java:44–52  ·  view source on GitHub ↗
(TransactionContext tcx, final String ID, final String name, final String zipcode)

Source from the content-addressed store, hash-verified

42 // TODO These three methods (setUser, getUser, and getUserIDsInRegion)
43 // are all in the recipe book.
44 public static void setUser(TransactionContext tcx, final String ID, final String name, final String zipcode){
45 tcx.run(new Function<Transaction,Void>() {
46 public Void apply(Transaction tr){
47 tr.set(main.pack(Tuple.from(ID,zipcode)), Tuple.from(name).pack());
48 tr.set(index.pack(Tuple.from(zipcode,ID)), Tuple.from().pack());
49 return null;
50 }
51 });
52 }
53
54 // Normal lookup.
55 public static String getUser(TransactionContext tcx, final String ID){

Callers 1

mainMethod · 0.95

Calls 1

runMethod · 0.65

Tested by

no test coverage detected