use of io.cdap.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, HTableDescriptorBuilder descriptorBuilder) {
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);
}
use of io.cdap.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, HTableDescriptorBuilder descriptorBuilder) {
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);
}
use of io.cdap.cdap.data2.dataset2.lib.hbase.AbstractHBaseDataSetAdmin in project cdap by cdapio.
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, HTableDescriptorBuilder descriptorBuilder) {
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