use of co.cask.cdap.data2.dataset2.lib.kv.NoTxKeyValueTable in project cdap by caskdata.
the class DatasetServiceStore method startUp.
@Override
protected void startUp() throws Exception {
final DatasetId serviceStoreDatasetInstanceId = NamespaceId.SYSTEM.dataset(Constants.Service.SERVICE_INSTANCE_TABLE_NAME);
table = Retries.supplyWithRetries(new Supplier<NoTxKeyValueTable>() {
@Override
public NoTxKeyValueTable get() {
try {
return DatasetsUtil.getOrCreateDataset(dsFramework, serviceStoreDatasetInstanceId, NoTxKeyValueTable.class.getName(), DatasetProperties.EMPTY, null);
} catch (Exception e) {
// Throwing RetryableException here is just to make it retry getting the dataset
// an exception here usually means there is an hbase problem
LOG.warn("Error getting service store dataset {}. Will retry after some time: {}", serviceStoreDatasetInstanceId, e.getMessage());
throw new RetryableException(e);
}
}
}, RetryStrategies.exponentialDelay(1, 30, TimeUnit.SECONDS));
}
Aggregations