hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Asaf Mesika <asaf.mes...@gmail.com>
Subject Re: Issues adding column families
Date Thu, 20 Jun 2013 18:12:33 GMT
if (!admin.tableExists(tableName)){

Shouldn't it be:
if (admin.tableExists(tableName)){

?


On Thu, Jun 20, 2013 at 6:42 PM, Aji Janis <aji1705@gmail.com> wrote:

> 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