Examples of listTables()


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

   * Delete all tables
   * @throws Exception
   */
  public void deleteAllTables() throws Exception {
    HBaseAdmin admin = htu.getHBaseAdmin();
    for(HTableDescriptor table:admin.listTables()) {
      admin.disableTable(table.getName());
      admin.deleteTable(table.getName());
    }
  }

View Full Code Here

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

   
    MiniHBaseCluster cluster = new MiniHBaseCluster(this.conf, 1);
    try {
      HBaseAdmin hb = new HBaseAdmin(this.conf);
      assertTrue(hb.isMasterRunning());
      HTableDescriptor [] tables = hb.listTables();
      boolean foundTable = false;
      for (int i = 0; i < tables.length; i++) {
        if (Bytes.equals(Bytes.toBytes(TABLENAME), tables[i].getName())) {
          foundTable = true;
          break;
View Full Code Here

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

    AccessTestAction listTablesAction = new AccessTestAction() {
      @Override
      public Object run() throws Exception {
        HBaseAdmin admin = new HBaseAdmin(TEST_UTIL.getConfiguration());
        try {
          admin.listTables();
        } finally {
          admin.close();
        }
        return null;
      }
View Full Code Here

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

    // name "GenericEndpoint" because "C" is before "G" lexicographically.

    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();

    // disable all user tables, if any are loaded.
    for (HTableDescriptor htd: admin.listTables()) {
      if (!htd.isMetaTable()) {
        String tableName = htd.getNameAsString();
        if (admin.isTableEnabled(tableName)) {
          try {
            admin.disableTable(htd.getNameAsString());
View Full Code Here

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

    super.setUp();
  }
 
  public void deleteAllTables() throws Exception {
    HBaseAdmin admin = hbaseUtil.getHBaseAdmin();
    for(HTableDescriptor table:admin.listTables()) {
      admin.disableTable(table.getName());
      admin.deleteTable(table.getName());
    }
  }
 
View Full Code Here

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

  }

  private HTableDescriptor[] getTableList() throws IOException {
    HBaseAdmin admin =
      new HBaseAdmin(RESTServlet.getInstance().getConfiguration());
    HTableDescriptor[] list = admin.listTables();
    if (LOG.isDebugEnabled()) {
      LOG.debug("getTableList:");
      for (HTableDescriptor htd: list) {
        LOG.debug(htd.toString());
      }
View Full Code Here

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

    PrivilegedExceptionAction listTablesAction = new PrivilegedExceptionAction() {
      @Override
      public Object run() throws Exception {
        HBaseAdmin admin = new HBaseAdmin(TEST_UTIL.getConfiguration());
        try {
          admin.listTables();
        } finally {
          admin.close();
        }
        return null;
      }
View Full Code Here

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

     * Disable and drop all the tables except SYSTEM.CATALOG and SYSTEM.SEQUENCE
     */
    protected static void disableAndDropNonSystemTables(PhoenixTestDriver driver) throws Exception {
        HBaseAdmin admin = driver.getConnectionQueryServices(null, null).getAdmin();
        try {
            HTableDescriptor[] tables = admin.listTables();
            for (HTableDescriptor table : tables) {
                boolean isCatalogTable = (Bytes.compareTo(table.getName(), PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME_BYTES) == 0);
                boolean isSequenceTable = (Bytes.compareTo(table.getName(), PhoenixDatabaseMetaData.SEQUENCE_TABLE_NAME_BYTES) == 0);
                if (!isCatalogTable && !isSequenceTable) {
                    admin.disableTable(table.getName());
View Full Code Here

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

   
    @Test
    public void testCreateTenantSpecificTable() throws Exception {
        // ensure we didn't create a physical HBase table for the tenant-specific table
        HBaseAdmin admin = driver.getConnectionQueryServices(getUrl(), PropertiesUtil.deepCopy(TEST_PROPERTIES)).getAdmin();
        assertEquals(0, admin.listTables(TENANT_TABLE_NAME).length);
    }
   
    @Test
    public void testCreateTenantTableTwice() throws Exception {
        try {
View Full Code Here

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

    PrivilegedExceptionAction listTablesAction = new PrivilegedExceptionAction() {
      @Override
      public Object run() throws Exception {
        HBaseAdmin admin = new HBaseAdmin(TEST_UTIL.getConfiguration());
        try {
          admin.listTables();
        } finally {
          admin.close();
        }
        return null;
      }
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.