hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aji Janis <aji1...@gmail.com>
Subject Issues adding column families
Date Thu, 20 Jun 2013 15:42:06 GMT
I have the following function for adding column family but its not working
for some reason. I am able to get proper configuration and establish the
right connection. Can anyone explain whats wrong?

Hbase version: http://archive.cloudera.com/cdh/3/*hbase-0.90.6-cdh3u5*
/apidocs/ <http://archive.cloudera.com/cdh/3/hbase-0.90.6-cdh3u5/apidocs/>
Thanks in advance.


public void addFamily(String tableName, ArrayList<String> families) throws
IOException{
admin = new HBaseAdmin(getConfiguration());
if (!admin.tableExists(tableName)){
if (families !=null){
admin.disableTable(tableName);
for (String fam: families) {
System.out.println("family to add: "+ fam);
admin.addColumn(tableName, new

    HColumnDescriptor(fam));
}
admin.enableTable(tableName);
}
admin.close();
}
}

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message