Package org.apache.hadoop.hbase.client

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


    HTableDescriptor htd = new HTableDescriptor(TEST_TABLE);
    htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
    Admin admin = UTIL.getHBaseAdmin();

    tableCreationLatch = new CountDownLatch(1);
    admin.createTable(htd);
    // preCreateTable can't bypass default action.
    assertTrue("Test table should be created", cp.wasCreateTableCalled());
    tableCreationLatch.await();
    assertTrue("Table pre create handler called.", cp
        .wasPreCreateTableHandlerCalled());
View Full Code Here


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

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

          admin.createTable(htd, splits);
        }
      } catch (MasterNotRunningException e) {
        LOG.error("Master not running", e);
        throw new IOException(e);
      } finally {
View Full Code Here

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

    admin.createTable(htd);
    assertTrue("Test table should be created", cp.wasCreateTableCalled());
    tableCreationLatch.await();
    assertTrue("Table pre create handler called.", cp
        .wasPreCreateTableHandlerCalled());
    assertTrue("Table create handler should be called.",
View Full Code Here

    Admin admin = TEST_UTIL.getHBaseAdmin();
    if (!admin.tableExists(TABLE)) {
    HTableDescriptor htd = new HTableDescriptor(TABLE);
    htd.addFamily(new HColumnDescriptor(CFA));
    htd.addFamily(new HColumnDescriptor(CFB));
    admin.createTable(htd);
    expectedRows1 = TestScannerResource.insertData(conf, TABLE, COLUMN_1, 1.0);
    expectedRows2 = TestScannerResource.insertData(conf, TABLE, COLUMN_2, 0.5);
    }
  }
View Full Code Here

      return;
    }
    HTableDescriptor htd = new HTableDescriptor(TABLE);
    htd.addFamily(new HColumnDescriptor(CFA));
    htd.addFamily(new HColumnDescriptor(CFB));
    admin.createTable(htd);
  }

  @AfterClass
  public static void tearDownAfterClass() throws Exception {
    REST_TEST_UTIL.shutdownServletContainer();
View Full Code Here

    if (admin.tableExists(TABLE)) {
      return;
    }
    HTableDescriptor htd = new HTableDescriptor(TABLE);
    htd.addFamily(new HColumnDescriptor(CFA));
    admin.createTable(htd);
  }

  @AfterClass
  public static void tearDownAfterClass() throws Exception {
    REST_TEST_UTIL.shutdownServletContainer();
View Full Code Here

    fam = new HColumnDescriptor(noRepfamName);
    table.addFamily(fam);
    Admin admin1 = new HBaseAdmin(conf1);
    Admin admin2 = new HBaseAdmin(conf2);
    admin1.createTable(table, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE);
    admin2.createTable(table, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE);
    htable1 = new HTable(conf1, tableName);
    htable1.setWriteBufferSize(1024);
    htable2 = new HTable(conf2, tableName);
  }
View Full Code Here

    int numClusters = configurations.length;
    for (int i = 0; i < numClusters; i++) {
      Admin hbaseAdmin = null;
      try {
        hbaseAdmin = new HBaseAdmin(configurations[i]);
        hbaseAdmin.createTable(table);
      } finally {
        close(hbaseAdmin);
      }
    }
  }
View Full Code Here

          "(regions per server: " + numRegionsPerServer + ")");

      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

    Admin admin = TEST_UTIL.getHBaseAdmin();
    if (!admin.tableExists(TABLE)) {
      HTableDescriptor htd = new HTableDescriptor(TABLE);
      htd.addFamily(new HColumnDescriptor(FAMILIES[0]));
      htd.addFamily(new HColumnDescriptor(FAMILIES[1]));
      admin.createTable(htd);
      Table table = new HTable(TEST_UTIL.getConfiguration(), TABLE);
      // Insert first half
      for(byte [] ROW : ROWS_ONE) {
        Put p = new Put(ROW);
        p.setDurability(Durability.SKIP_WAL);
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.