use of io.cdap.cdap.data.RuntimeProgramContextAware in project cdap by caskdata.
the class AbstractContext method getDataset.
@Override
public <T extends Dataset> T getDataset(final String namespace, final String name, final Map<String, String> arguments, final AccessType accessType) throws DatasetInstantiationException {
return Retries.callWithRetries(() -> {
T dataset = datasetCache.getDataset(namespace, name, arguments, accessType);
if (dataset instanceof RuntimeProgramContextAware) {
DatasetId datasetId = new NamespaceId(namespace).dataset(name);
((RuntimeProgramContextAware) dataset).setContext(createRuntimeProgramContext(datasetId));
}
return dataset;
}, retryStrategy);
}
use of io.cdap.cdap.data.RuntimeProgramContextAware in project cdap by cdapio.
the class AbstractContext method getDataset.
@Override
public <T extends Dataset> T getDataset(final String namespace, final String name, final Map<String, String> arguments, final AccessType accessType) throws DatasetInstantiationException {
return Retries.callWithRetries(() -> {
T dataset = datasetCache.getDataset(namespace, name, arguments, accessType);
if (dataset instanceof RuntimeProgramContextAware) {
DatasetId datasetId = new NamespaceId(namespace).dataset(name);
((RuntimeProgramContextAware) dataset).setContext(createRuntimeProgramContext(datasetId));
}
return dataset;
}, retryStrategy);
}
Aggregations