Examples of listTables()


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

  }

  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

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

    final String HBASE_TABLE_NAME = "HiveExternalTable";
    HTableDescriptor htableDesc = new HTableDescriptor(HBASE_TABLE_NAME.getBytes());
    HColumnDescriptor hcolDesc = new HColumnDescriptor("cf".getBytes());
    htableDesc.addFamily(hcolDesc);
    HBaseAdmin hbaseAdmin = new HBaseAdmin(hbaseConf);
    if(Arrays.asList(hbaseAdmin.listTables()).contains(htableDesc)){
      // if table is already in there, don't recreate.
      return;
    }
    hbaseAdmin.createTable(htableDesc);
    HTable htable = new HTable(hbaseConf, HBASE_TABLE_NAME);
View Full Code Here

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

      }

      if (admin.isTableDisabled(TEST_TABLE)) {
         admin.enableTable(TEST_TABLE);
      }
      HTableDescriptor[] tables = admin.listTables();
      for (HTableDescriptor t : tables) {
         LOG.info(t.getNameAsString());
      }
   }
View Full Code Here

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

            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

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

   
    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

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

        String tableNameSpec = indexerConf.getTable();
        if (indexerConf.tableNameIsRegex()) {
            HTableDescriptor[] tables;
            try {
                HBaseAdmin admin = getHbaseAdmin();
                tables = admin.listTables(tableNameSpec);
            } catch (IOException e) {
                throw new RuntimeException("Error occurred fetching hbase tables", e);
            }
            for (HTableDescriptor descriptor : tables) {
                tableNames.add(descriptor.getName());
View Full Code Here

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

    public void setUp() throws /*ZkConnectException,*/ InterruptedException, /*KeeperException,*/ IOException {
        conf = new Configuration();
        opts = new HBaseIndexingOptions(conf);

        HBaseAdmin hBaseAdmin = Mockito.mock(HBaseAdmin.class);
        Mockito.when(hBaseAdmin.listTables("record")).thenReturn(new HTableDescriptor[]{
                new HTableDescriptor("record")
        });
        opts.hBaseAdmin = hBaseAdmin;
    }
   
View Full Code Here

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

            cleanZooKeeper("localhost:" + hbaseTestUtil.getZkCluster().getClientPort(), "/ngdata");

            // Delete all hbase tables
            System.out.println(">>> Deleting all HBase tables");
            HBaseAdmin admin = new HBaseAdmin(conf);
            for (HTableDescriptor table : admin.listTables()) {
                admin.disableTable(table.getName());
                admin.deleteTable(table.getName());
            }
            admin.close();
View Full Code Here

Examples of org.apache.sqoop.manager.CubridManager.listTables()

    options.setConnectString(CubridTestUtils.getConnectString());
    options.setUsername(CubridTestUtils.getCurrentUser());
    options.setPassword(CubridTestUtils.getPassword());

    ConnManager mgr = new CubridManager(options);
    String[] tables = mgr.listTables();
    Arrays.sort(tables);
    assertTrue(TABLE_NAME + " is not found!",
        Arrays.binarySearch(tables, TABLE_NAME) >= 0);
  }
View Full Code Here

Examples of org.apache.sqoop.manager.CubridManager.listTables()

    options.setConnectString(CubridTestUtils.getConnectString());
    options.setUsername(CubridTestUtils.getCurrentUser());
    options.setPassword(CubridTestUtils.getPassword());

    ConnManager mgr = new CubridManager(options);
    String[] tables = mgr.listTables();
    Arrays.sort(tables);
    assertTrue(TABLE_NAME + " is not found!",
        Arrays.binarySearch(tables, TABLE_NAME) >= 0);
  }
}
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.