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


                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    // do nothing.
                }
            }
            admin.deleteTable(TESTTABLE);
        }
    }

}
View Full Code Here

    //Now delete the table from hbase
    if (hAdmin.isTableEnabled("mytable")) {
      hAdmin.disableTable("mytable");
    }
    hAdmin.deleteTable("mytable");
    doesTableExist = hAdmin.tableExists("mytable");
    assertTrue(doesTableExist == false);

    CommandProcessorResponse responseTwo = hcatDriver.run("drop table mytable");
    assertTrue(responseTwo.getResponseCode() == 0);
View Full Code Here

      // Modify the table removing one family and verify the descriptor
      admin.addColumn(TABLE_NAME, new HColumnDescriptor(FAMILY_1));
      verifyTableDescriptor(TABLE_NAME, FAMILY_0, FAMILY_1);
    } finally {
      admin.deleteTable(TABLE_NAME);
    }
  }

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

      // Modify the table removing one family and verify the descriptor
      admin.deleteColumn(TABLE_NAME, FAMILY_1);
      verifyTableDescriptor(TABLE_NAME, FAMILY_0);
    } finally {
      admin.deleteTable(TABLE_NAME);
    }
  }

  private void verifyTableDescriptor(final byte[] tableName, final byte[]... families)
      throws IOException {
View Full Code Here

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

  public void shutdownMiniCluster() throws IOException {
    hbaseCluster.shutdown();
View Full Code Here

      callRollBack = false;
      cluster.getMaster().setCatalogJanitorEnabled(true);
    }
    if (admin.isTableAvailable(tableName) && admin.isTableEnabled(tableName)) {
      admin.disableTable(tableName);
      admin.deleteTable(tableName);
      admin.close();
    }
  }

  /**
 
View Full Code Here

      assertTrue(st.rollback(regionServer, regionServer));
      assertTrue(ZKUtil.checkExists(regionServer.getZooKeeper(), node) == -1);
    }
    if (admin.isTableAvailable(tableName) && admin.isTableEnabled(tableName)) {
      admin.disableTable(tableName);
      admin.deleteTable(tableName);
    }
  }
 
  @Test
  public void testShouldClearRITWhenNodeFoundInSplittingState() throws Exception {
View Full Code Here

      assertFalse("region is still in transition",
          am.getRegionsInTransition().containsKey(region.getRegionInfo().getEncodedName()));
    }
    if (admin.isTableAvailable(tableName) && admin.isTableEnabled(tableName)) {
      admin.disableTable(tableName);
      admin.deleteTable(tableName);
      admin.close();
    }
  }
 
  @Test(timeout = 20000)
View Full Code Here

    public synchronized static void dropTableIfExists(byte[] tableName) throws IOException {
        HBaseAdmin admin = HBaseUtils.getHBaseAdmin();
        if (admin.tableExists(tableName)) {
            admin.disableTable(tableName);
            admin.deleteTable(tableName);
        }
    }
}
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.