use of co.cask.cdap.etl.api.Lookup in project cdap by caskdata.
the class TxLookupProvider method executeLookup.
@Nullable
private <T, R> R executeLookup(final String table, final Map<String, String> arguments, final Function<Lookup<T>, R> func) {
final AtomicReference<R> result = new AtomicReference<>();
Transactionals.execute(tx, new TxRunnable() {
@Override
public void run(DatasetContext context) throws Exception {
Lookup<T> lookup = getLookup(table, context.getDataset(table, arguments));
result.set(func.apply(lookup));
}
});
return result.get();
}
Aggregations