HBase create table delete table operation

From , 5 Years ago, written in Java, viewed 200 times.
URL https://pastebin.vip/view/4b04a686
  1. HBaseAdmin hAdmin = new HBaseAdmin(hbaseConfig);
  2.  
  3. HTableDescriptor t = new HTableDescriptor(tableName);
  4.  
  5. t.addFamily(new HColumnDescriptor(“f1″));
  6.  
  7. t.addFamily(new HColumnDescriptor(“f2″));
  8.  
  9. t.addFamily(new HColumnDescriptor(“f3″));
  10.  
  11. t.addFamily(new HColumnDescriptor(“f4″));
  12.  
  13. hAdmin.createTable(t);
  14.  
  15.  
  16.  
  17. HBaseAdmin hAdmin = new HBaseAdmin(hbaseConfig);
  18.  
  19. if (hAdmin.tableExists(tableName)) {
  20.  
  21.        hAdmin.disableTable(tableName);
  22.  
  23.        hAdmin.deleteTable(tableName);
  24.  
  25. }

Reply to "HBase create table delete table operation"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website