Package org.apache.hadoop.hbase.client

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


    HColumnDescriptor family = new HColumnDescriptor("fam");
    desc.addFamily(family);
    LOG.info("Creating table " + tableName);
    HBaseAdmin admin = new HBaseAdmin(TEST_UTIL.getConfiguration());
    try {
      admin.createTable(desc);
    } finally {
      admin.close();
    }

    HTable table =
View Full Code Here


    try {
      byte[][] SPLIT_KEYS = new byte[][] { Bytes.toBytes("a"), Bytes.toBytes("b"),
        Bytes.toBytes("c"), Bytes.toBytes("d"), Bytes.toBytes("e"), Bytes.toBytes("f"),
        Bytes.toBytes("g"), Bytes.toBytes("h"), Bytes.toBytes("i"), Bytes.toBytes("j") };
      String tableName = "testRegionAssignmentAfterMasterRecoveryDueToZKExpiry";
      admin.createTable(new HTableDescriptor(TableName.valueOf(tableName)), SPLIT_KEYS);
      ZooKeeperWatcher zooKeeperWatcher = HBaseTestingUtility.getZooKeeperWatcher(TEST_UTIL);
      ZKAssign.blockUntilNoRIT(zooKeeperWatcher);
      m.getZooKeeperWatcher().close();
      MockLoadBalancer.retainAssignCalled = false;
      m.abort("Test recovery from zk session expired",
View Full Code Here

      String tableName = "testLogSplittingAfterMasterRecoveryDueToZKExpiry";
      HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName));
      HColumnDescriptor hcd = new HColumnDescriptor("col");
      htd.addFamily(hcd);
      admin.createTable(htd, SPLIT_KEYS);
      ZooKeeperWatcher zooKeeperWatcher = HBaseTestingUtility.getZooKeeperWatcher(TEST_UTIL);
      ZKAssign.blockUntilNoRIT(zooKeeperWatcher);
      table = new HTable(TEST_UTIL.getConfiguration(), tableName);
      Put p;
      int numberOfPuts;
View Full Code Here

    }
    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TABLE));
    htd.addFamily(new HColumnDescriptor(COLUMN_1).setMaxVersions(3));
    htd.addFamily(new HColumnDescriptor(COLUMN_2).setMaxVersions(3));
    htd.addFamily(new HColumnDescriptor(COLUMN_3).setMaxVersions(3));
    admin.createTable(htd);
    HTable table = null;
    try {
      table = new HTable(TEST_UTIL.getConfiguration(), TABLE);
      Put put = new Put(ROW_1);
      put.add(COLUMN_1, QUALIFIER_1, TS_2, VALUE_1);
View Full Code Here

  private void setupReplication() throws Exception {
    ReplicationAdmin admin1 = new ReplicationAdmin(conf1);
    ReplicationAdmin admin2 = new ReplicationAdmin(conf2);

    HBaseAdmin ha = new HBaseAdmin(conf1);
    ha.createTable(t1_syncupSource);
    ha.createTable(t2_syncupSource);
    ha.close();

    ha = new HBaseAdmin(conf2);
    ha.createTable(t1_syncupTarget);
View Full Code Here

    ReplicationAdmin admin1 = new ReplicationAdmin(conf1);
    ReplicationAdmin admin2 = new ReplicationAdmin(conf2);

    HBaseAdmin ha = new HBaseAdmin(conf1);
    ha.createTable(t1_syncupSource);
    ha.createTable(t2_syncupSource);
    ha.close();

    ha = new HBaseAdmin(conf2);
    ha.createTable(t1_syncupTarget);
    ha.createTable(t2_syncupTarget);
View Full Code Here

    ha.createTable(t1_syncupSource);
    ha.createTable(t2_syncupSource);
    ha.close();

    ha = new HBaseAdmin(conf2);
    ha.createTable(t1_syncupTarget);
    ha.createTable(t2_syncupTarget);
    ha.close();

    // Get HTable from Master
    ht1Source = new HTable(conf1, t1_su);
View Full Code Here

    ha.createTable(t2_syncupSource);
    ha.close();

    ha = new HBaseAdmin(conf2);
    ha.createTable(t1_syncupTarget);
    ha.createTable(t2_syncupTarget);
    ha.close();

    // Get HTable from Master
    ht1Source = new HTable(conf1, t1_su);
    ht1Source.setWriteBufferSize(1024);
View Full Code Here

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

    tabledesc.addFamily(family);

    // create the table
    HBaseAdmin admin = new HBaseAdmin(conf);
    deleteTable(tableName);
    admin.createTable(tabledesc);

    if (initData) {
      // put some data into table in the increasing order of row key
      HTable table = new HTable(conf, 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.