Package org.apache.hadoop.hbase.client

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


    // turn off bypass, run the tests again
    cp.enableBypass(false);
    cp.resetStates();

    admin.createTable(htd);
    assertTrue("Test table should be created", cp.wasCreateTableCalled());

    // disable
    assertFalse(cp.wasDisableTableCalled());
View Full Code Here


    // delete table if exists
    if (admin.tableExists(TEST_TABLE)) {
      UTIL.deleteTable(TEST_TABLE);
    }

    admin.createTable(htd);
    admin.disableTable(TEST_TABLE);
    assertTrue(admin.isTableDisabled(TEST_TABLE));

    try {
      // Test snapshot operation
View Full Code Here

    htd.addFamily(hcd);
    hcd = new HColumnDescriptor(TEST_FAMILY2);
    hcd.setMaxVersions(4);
    htd.setOwner(USER_OWNER);
    htd.addFamily(hcd);
    admin.createTable(htd, new byte[][] { Bytes.toBytes("s") });
    TEST_UTIL.waitTableEnabled(TEST_TABLE.getTableName().getName());
  }

  @Test
  public void testCellPermissionwithVersions() throws Exception {
View Full Code Here

          "(default regions per server: " + DEFAULT_REGIONS_PER_SERVER + ")");

      byte[][] splits = new RegionSplitter.HexStringSplit().split(
          totalNumberOfRegions);

      admin.createTable(desc, splits);
    } catch (MasterNotRunningException e) {
      LOG.error("Master not running", e);
      throw new IOException(e);
    } catch (TableExistsException e) {
      LOG.warn("Table " + desc.getTableName() +
View Full Code Here

  public void testLoadAndVerify() throws Exception {
    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TEST_NAME));
    htd.addFamily(new HColumnDescriptor(TEST_FAMILY));

    HBaseAdmin admin = getTestingUtil(getConf()).getHBaseAdmin();
    admin.createTable(htd, Bytes.toBytes(0L), Bytes.toBytes(-1L), 40);

    doLoad(getConf(), htd);
    doVerify(getConf(), htd);

    // Only disable and drop if we succeeded to verify - otherwise it's useful
View Full Code Here

    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(table));
    htd.addFamily(new HColumnDescriptor(TEST_FAMILY));

    HBaseAdmin admin = new HBaseAdmin(getConf());
    if (doLoad) {
      admin.createTable(htd, Bytes.toBytes(0L), Bytes.toBytes(-1L), numPresplits);
      doLoad(getConf(), htd);
    }
    if (doVerify) {
      doVerify(getConf(), htd);
      if (doDelete) {
View Full Code Here

  private static HTable createTable(int splits, HColumnDescriptor hcol) throws Exception {
    byte[] tableName = Bytes.toBytes("test_table_" + RANDOM.nextInt(1000000000));
    HBaseAdmin admin = HBASE_TEST_UTILITY.getHBaseAdmin();
    HTableDescriptor htable = new HTableDescriptor(tableName);
    htable.addFamily(hcol);
    admin.createTable(htable, Bytes.split(Bytes.toBytes("a"), Bytes.toBytes("z"), splits));
    HBASE_TEST_UTILITY.waitTableAvailable(tableName, 30000);
    return new HTable(HBASE_TEST_UTILITY.getConfiguration(), tableName);
  }

  @AfterClass
View Full Code Here

    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(table));
    htd.addFamily(new HColumnDescriptor(TEST_FAMILY));

    HBaseAdmin admin = new HBaseAdmin(getConf());
    try {
      admin.createTable(htd, Bytes.toBytes(0L), Bytes.toBytes(-1L), numPresplits);
    } finally {
      admin.close();
    }
    doLoad(getConf(), htd);
    doVerify(getConf(), htd);
View Full Code Here

        // create the table
        HBaseAdmin admin = new HBaseAdmin(conf);
        if(admin.tableExists(TESTTABLE)) {
            deleteTable();
        }
        admin.createTable(tabledesc);
       
        // put some data into table
        HTable table = new HTable(conf, TESTTABLE);
       
        BatchUpdate batchUpdate;
View Full Code Here

      HTableDescriptor tableDesc = new HTableDescriptor(tableName);
      for (String family : families) {
        HColumnDescriptor columnDescriptor = new HColumnDescriptor(family);
        tableDesc.addFamily(columnDescriptor);
      }
      admin.createTable(tableDesc);
    } catch (Exception e) {
      e.printStackTrace();
      throw new IllegalStateException(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.