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

Method apply

recipes/java-recipes/MicroDoc.java:155–164  ·  view source on GitHub ↗
(Transaction tr)

Source from the content-addressed store, hash-verified

153 public static Object insertDoc(TransactionContext tcx, final Map<Object,Object> doc){
154 return tcx.run(new Function<Transaction,Object>() {
155 public Object apply(Transaction tr){
156 if(!doc.containsKey("doc_id")){
157 doc.put("doc_id", getNewID(tr));
158 }
159 for(Tuple t : toTuples(doc)){
160 tr.set(docSpace.pack(Tuple.from(doc.get("doc_id")).addAll(t.popBack())),
161 Tuple.from(t.get(t.size() - 1)).pack());
162 }
163 return doc.get("doc_id");
164 }
165 });
166 }
167

Callers

nothing calls this directly

Calls 15

getNewIDMethod · 0.95
toTuplesMethod · 0.95
fromMethod · 0.95
fromBytesMethod · 0.95
fromTuplesMethod · 0.95
tupleRepMethod · 0.95
putMethod · 0.80
addAllMethod · 0.80
randomMethod · 0.80
setMethod · 0.65
getMethod · 0.65
getRangeMethod · 0.65

Tested by

no test coverage detected