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

Method getCounts

recipes/java-recipes/MicroMulti.java:111–124  ·  view source on GitHub ↗
(TransactionContext tcx,
												final String index)

Source from the content-addressed store, hash-verified

109 }
110
111 public static HashMap<Object,Long> getCounts(TransactionContext tcx,
112 final String index){
113 return tcx.run(new Function<Transaction,HashMap<Object,Long> >() {
114 public HashMap<Object,Long> apply(Transaction tr){
115 HashMap<Object,Long> vals = new HashMap<Object,Long>();
116 for(KeyValue kv : tr.getRange(multi.subspace(
117 Tuple.from(index)).range())){
118 vals.put(multi.unpack(kv.getKey()).get(1),
119 getLong(kv.getValue()));
120 }
121 return vals;
122 }
123 });
124 }
125
126 public static boolean isElement(TransactionContext tcx, final String index,
127 final Object value){

Callers 1

mainMethod · 0.95

Calls 1

runMethod · 0.65

Tested by

no test coverage detected