Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.HBaseAdmin.deleteTable()


      admin.deleteSnapshot(TEST_SNAPSHOT);
      assertTrue("Coprocessor should have been called on snapshot delete",
        cp.wasDeleteSnapshotCalled());
    } finally {
      admin.deleteTable(TEST_TABLE);
    }
  }

  private void waitForRITtoBeZero(HMaster master) throws IOException {
    // wait for assignments to finish
View Full Code Here


      modifiedHtd.addFamily(new HColumnDescriptor(FAMILY_0));
      modifiedHtd.addFamily(new HColumnDescriptor(FAMILY_1));
      admin.modifyTable(TABLE_NAME, modifiedHtd);
      verifyTableDescriptor(TABLE_NAME, FAMILY_0, FAMILY_1);
    } finally {
      admin.deleteTable(TABLE_NAME);
    }
  }

  @Test
  public void testAddColumn() throws IOException {
View Full Code Here

     HBaseAdmin hbase = new HBaseAdmin(conf);
     HTableDescriptor[] wordcounts = hbase.listTables("wordcount");
     
     if(wordcounts.length != 0){ //Drop Table if Exists
        hbase.disableTable(TABLE_NAME);
       hbase.deleteTable(TABLE_NAME);
     }
    
     HTableDescriptor wordcount = new HTableDescriptor(TABLE_NAME);
     hbase.createTable(wordcount);
     // Cannot edit a stucture on an active table.
View Full Code Here

      tables.remove(tableName);
    }
   
    for (String table : tables) {
      admin.disableTable(table);
      admin.deleteTable(table);
    }
  }
 
  private HTableDescriptor createTable(String tableName) {
    HTableDescriptor descriptor = new HTableDescriptor(tableName);
View Full Code Here

      HBaseAdmin admin = new HBaseAdmin(config);
      HTableDescriptor[] descriptors = admin.listTables();
      for (HTableDescriptor hTableDescriptor : descriptors) {
        String name = hTableDescriptor.getNameAsString();
        admin.disableTable(name);
        admin.deleteTable(name);
      }
    } catch(IOException e) {
      throw new SienaException(e);
    }
  }
View Full Code Here

      } catch (IOException e) {
      }
      if (!success) {
        throw new IOException("could not disable table");
      }
      admin.deleteTable(actualTableName);
      return Response.ok().build();
    } catch (TableNotFoundException e) {
      throw new WebApplicationException(Response.Status.NOT_FOUND);
    } catch (IOException e) {
      throw new WebApplicationException(e,
View Full Code Here

    g.addFamily(cf.getBytes());
    hTable.get(g);
    assertTimeVaryingMetricCount(1, TABLE_NAME, cf, regionName, "get_");
    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
    admin.disableTable(TABLE_NAME.getBytes());
    admin.deleteTable(TABLE_NAME.getBytes());

    assertTimeVaryingMetricCount(0, TABLE_NAME, cf, regionName, "get_");

    hTable.close();
  }
View Full Code Here

      HBaseAdmin hba = new HBaseAdmin(hc);
      log.info("Creating Table {}", output);
     
      if (hba.tableExists(output)) {
        hba.disableTable(output);
        hba.deleteTable(output);
        hba.majorCompact(".META.");
      }
      hba.createTable(ht);
      conf.set("output.table", output);
    }
View Full Code Here

    // create table
    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
    if (admin.tableExists(tableName)) {
      admin.disableTable(tableName);
      admin.deleteTable(tableName);
    }
    HTableDescriptor htd = new HTableDescriptor(tableName);
    htd.addFamily(new HColumnDescriptor(family1));
    htd.addFamily(new HColumnDescriptor(family2));
    admin.createTable(htd);
View Full Code Here

    verifyDenied(gblUser, putActionAll, putAction1, putAction2);
    verifyDenied(gblUser, deleteActionAll, deleteAction1, deleteAction2);

    // delete table
    admin.disableTable(tableName);
    admin.deleteTable(tableName);
  }

  private boolean hasFoundUserPermission(UserPermission userPermission, List<UserPermission> perms) {
    return perms.contains(userPermission);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.