HBASE-12412 update the ref guide example 2 in HBase APIs chapter with the new API modifyFamily in master

This commit is contained in:
Misty Stanley-Jones 2015-02-10 14:38:41 +10:00
parent d3621d24de
commit bfc2bc7fa2
1 changed files with 7 additions and 0 deletions

View File

@ -111,6 +111,13 @@ public static void upgradeFrom0 (Configuration config) {
newColumn.setMaxVersions(HConstants.ALL_VERSIONS);
admin.addColumn(tableName, newColumn);
// Update existing column family
HColumnDescriptor existingColumn = new HColumnDescriptor(CF_DEFAULT);
existingColumn.setCompactionCompressionType(Algorithm.GZ);
existingColumn.setMaxVersions(HConstants.ALL_VERSIONS);
table_assetmeta.modifyFamily(existingColumn)
admin.modifyTable(tableName, table_assetmeta);
// Disable an existing table
admin.disableTable(tableName);