private static void upgradeUserTables(final Injector injector) throws Exception {
// We assume that all tables in USER namespace belong to OrderedTable type datasets. So we loop thru them
// and upgrading with the help of HBaseOrderedTableAdmin
final CConfiguration cConf = injector.getInstance(CConfiguration.class);
DefaultDatasetNamespace namespace = new DefaultDatasetNamespace(cConf, Namespace.USER);
Configuration hConf = injector.getInstance(Configuration.class);
HBaseAdmin hAdmin = new HBaseAdmin(hConf);
final HBaseTableUtil hBaseTableUtil = injector.getInstance(HBaseTableUtil.class);
for (HTableDescriptor desc : hAdmin.listTables()) {
String tableName = desc.getNameAsString();
// todo: it works now, but we will want to change it if namespacing of datasets in HBase is more than +prefix
if (namespace.fromNamespaced(tableName) != null) {
System.out.println(String.format("Upgrading hbase table: %s, desc: %s", tableName, desc.toString()));
final boolean supportsIncrement =
"true".equalsIgnoreCase(desc.getValue(OrderedTable.PROPERTY_READLESS_INCREMENT));
DatasetAdmin admin = new AbstractHBaseDataSetAdmin(tableName, hConf, hBaseTableUtil) {