Package org.apache.hadoop.hbase.client

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


  }

  private final TableListModel getTableList() throws IOException {
    TableListModel tableList = new TableListModel();
    HBaseAdmin admin = new HBaseAdmin(servlet.getConfiguration());
    HTableDescriptor[] list = admin.listTables();
    for (HTableDescriptor htd: list) {
      tableList.add(new TableModel(htd.getNameAsString()));
    }
    return tableList;
  }
View Full Code Here

    // 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

    HBaseAdmin hbaseAdmin = null;
    HTableInterface htable = null;
    try {
      hbaseAdmin = new HBaseAdmin(hbaseConn.getConfiguration());
      if (Arrays.asList(hbaseAdmin.listTables()).contains(htableDesc)) {
        // if table is already in there, don't recreate.
        return;
      }
      hbaseAdmin.createTable(htableDesc);
      htable = hbaseConn.getTable(HBASE_TABLE_NAME);
View Full Code Here

    // 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

   
    @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(), TEST_PROPERTIES).getAdmin();
        assertEquals(0, admin.listTables(TENANT_TABLE_NAME).length);
    }
   
    @Test
    public void testCreateTenantTableTwice() throws Exception {
        try {
View Full Code Here

    }

    @Override
    public Set<String> getTableNames() {
      try(HBaseAdmin admin = new HBaseAdmin(plugin.getConfig().getHBaseConf())) {
        HTableDescriptor[] tables = admin.listTables();
        Set<String> tableNames = Sets.newHashSet();
        for (HTableDescriptor table : tables) {
          tableNames.add(new String(table.getName()));
        }
        return tableNames;
View Full Code Here

            IntegrationTestingUtility util =  new IntegrationTestingUtility(config);
            util.initializeCluster(this.NUM_SLAVES_BASE);
            this.util = util;
            // remove all hbase tables
            HBaseAdmin admin = util.getHBaseAdmin();
            HTableDescriptor[] tables = admin.listTables();
            for(HTableDescriptor table : tables){
                util.deleteTable(table.getName());
            }
        } else {
            util = new HBaseTestingUtility(config);
View Full Code Here

   
    private void teardownServer() throws Exception {
        if(isDistributedCluster(util.getConfiguration())){
            // remove all hbase tables
            HBaseAdmin admin = util.getHBaseAdmin();
            HTableDescriptor[] tables = admin.listTables();
            for(HTableDescriptor table : tables){
                util.deleteTable(table.getName());
            }
        } else {
            util.shutdownMiniCluster();
View Full Code Here

 
  public static Set<String> getTableNames() {
    Set<String> tableNames = new CopyOnWriteArraySet<String>();
    try {
      HBaseAdmin admin = new HBaseAdmin(hconf);
      HTableDescriptor[] td = admin.listTables();
      for(HTableDescriptor table : td) {
        tableNames.add(new String(table.getName()));
      }
    } catch(Exception e) {
      log.error(ExceptionUtil.getStackTrace(e));
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.