| 30 | | HBaseAdmin admin; |
| 31 | | try { |
| 32 | | admin = new HBaseAdmin(conf); |
| 33 | | if (admin.tableExists(tablename)) { |
| 34 | | admin.disableTable(tablename); |
| 35 | | admin.deleteTable(tablename); |
| 36 | | System.out.println("Droped the table [" + tablename + "]"); |
| 37 | | } else { |
| 38 | | System.out.println("Table [" + tablename + "] was not found!"); |
| 39 | | } |
| | 31 | HBaseAdmin admin; |
| | 32 | try { |
| | 33 | admin = new HBaseAdmin(conf); |
| | 34 | if (admin.tableExists(tablename)) { |
| | 35 | admin.disableTable(tablename); |
| | 36 | admin.deleteTable(tablename); |
| | 37 | System.out.println("Droped the table [" + tablename + "]"); |
| | 38 | } else { |
| | 39 | System.out.println("Table [" + tablename + "] was not found!"); |
| | 40 | } |
| 46 | | public static void main(String[] argv) { |
| 47 | | |
| 48 | | String[] otherArgs = new GenericOptionsParser(new Configuration(), argv) |
| 49 | | .getRemainingArgs(); |
| 50 | | if (otherArgs.length < 1) { |
| 51 | | System.out.println("DropTable <TableName> "); |
| 52 | | return; |
| 53 | | } |
| 54 | | |
| 55 | | drop(otherArgs[0]); |
| 56 | | } |
| | 47 | public static void main(String[] argv) { |
| | 48 | // eclipse only |
| | 49 | String[] arg = {"ex1Table"}; |
| | 50 | argv = arg; |
| | 51 | String[] otherArgs = new GenericOptionsParser(new Configuration(), argv) |
| | 52 | .getRemainingArgs(); |
| | 53 | if (otherArgs.length < 1) { |
| | 54 | System.out.println("DropTable <TableName> "); |
| | 55 | return; |
| | 56 | } |
| | 57 | |
| | 58 | drop(otherArgs[0]); |
| | 59 | } |