/** * Get {@link TableDescriptorBuilder} with default properties set. * @param tableId id of the table for which the descriptor is to be returned * @param cConf the instance of the {@link CConfiguration} * @return the builder with default properties set */ public static TableDescriptorBuilder getTableDescriptorBuilder(TableId tableId, CConfiguration cConf) { String tablePrefix = cConf.get(Constants.Dataset.TABLE_PREFIX); TableName tableName = HTableNameConverter.toTableName(tablePrefix, tableId); TableDescriptorBuilder tdBuilder = new TableDescriptorBuilder(tableName.getNamespaceAsString(), tableName.getQualifierAsString()); tdBuilder .addProperty(Constants.Dataset.TABLE_PREFIX, tablePrefix) .addProperty(HBaseTableUtil.CDAP_VERSION, ProjectInfo.getVersion().toString()) .addProperty(HBaseTableUtil.CDAP_HBASE_VERSION, HBaseVersion.get().getMajorVersion()); return tdBuilder; }
/** * Get {@link TableDescriptorBuilder} with default properties set. * @param tableId id of the table for which the descriptor is to be returned * @param cConf the instance of the {@link CConfiguration} * @return the builder with default properties set */ public static TableDescriptorBuilder getTableDescriptorBuilder(TableId tableId, CConfiguration cConf) { String tablePrefix = cConf.get(Constants.Dataset.TABLE_PREFIX); TableName tableName = HTableNameConverter.toTableName(tablePrefix, tableId); TableDescriptorBuilder tdBuilder = new TableDescriptorBuilder(tableName.getNamespaceAsString(), tableName.getQualifierAsString()); tdBuilder .addProperty(Constants.Dataset.TABLE_PREFIX, tablePrefix) .addProperty(HBaseTableUtil.CDAP_VERSION, ProjectInfo.getVersion().toString()) .addProperty(HBaseTableUtil.CDAP_HBASE_VERSION, HBaseVersion.get().getMajorVersion()); return tdBuilder; }