use of co.cask.cdap.data2.dataset2.lib.hbase.AbstractHBaseDataSetAdmin in project cdap by caskdata.
the class DatasetUpgrader method upgradeUserTable.
private void upgradeUserTable(HTableDescriptor desc) throws IOException {
TableId tableId = HTableNameConverter.from(desc);
LOG.info("Upgrading hbase table: {}, desc: {}", tableId, desc);
final boolean supportsIncrement = HBaseTableAdmin.supportsReadlessIncrements(desc);
final boolean transactional = HBaseTableAdmin.isTransactional(desc);
DatasetAdmin admin = new AbstractHBaseDataSetAdmin(tableId, hConf, cConf, hBaseTableUtil, locationFactory) {
@Override
protected CoprocessorJar createCoprocessorJar() throws IOException {
return HBaseTableAdmin.createCoprocessorJarInternal(cConf, coprocessorManager, hBaseTableUtil, transactional, supportsIncrement);
}
@Override
protected boolean needsUpdate(HTableDescriptor tableDescriptor) {
return false;
}
@Override
public void create() throws IOException {
// no-op
throw new UnsupportedOperationException("This DatasetAdmin is only used for upgrade() operation");
}
};
admin.upgrade();
LOG.info("Upgraded hbase table: {}", tableId);
}
Aggregations