Package org.apache.hadoop.hbase.client

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


      HBaseAdmin admin = new HBaseAdmin(getConf());
      byte[] tableName = getTableName(getConf());
      if (!admin.tableExists(tableName)) {
        HTableDescriptor htd = new HTableDescriptor(getTableName(getConf()));
        htd.addFamily(new HColumnDescriptor(FAMILY_NAME));
        admin.createTable(htd);
      }
      admin.close();
    }

    public int runRandomInputGenerator(int numMappers, long numNodes, Path tmpOutput,
View Full Code Here


    HBaseAdmin admin = new HBaseAdmin(util.getConfiguration());
    HTableDescriptor htd = new HTableDescriptor(TABLE);
    HColumnDescriptor familyDesc = new HColumnDescriptor(FAMILY);
    familyDesc.setBloomFilterType(bloomType);
    htd.addFamily(familyDesc);
    admin.createTable(htd, SPLIT_KEYS);

    HTable table = new HTable(util.getConfiguration(), TABLE);
    util.waitTableAvailable(TABLE, 30000);

    LoadIncrementalHFiles loader =
View Full Code Here

    HBaseAdmin admin = new HBaseAdmin(util.getConfiguration());
    HTableDescriptor htd = new HTableDescriptor(TABLE);
    HColumnDescriptor familyDesc = new HColumnDescriptor(FAMILY);
    htd.addFamily(familyDesc);
    admin.createTable(htd, SPLIT_KEYS);

    HTable table = new HTable(util.getConfiguration(), TABLE);
    util.waitTableAvailable(TABLE, 30000);
    LoadIncrementalHFiles loader =
        new LoadIncrementalHFiles(util.getConfiguration(), useSecureHBaseOverride);
View Full Code Here

    final byte[] TABLE = Bytes.toBytes("mytable_"+testName);

    HBaseAdmin admin = new HBaseAdmin(util.getConfiguration());
    HTableDescriptor htd = new HTableDescriptor(TABLE);
    admin.createTable(htd, SPLIT_KEYS);

    HTable table = new HTable(util.getConfiguration(), TABLE);
    util.waitTableAvailable(TABLE, 30000);
    // make sure we go back to the usual user provider
    UserProvider.setUserProviderForTesting(util.getConfiguration(), UserProvider.class);
View Full Code Here

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

   
    HBaseAdmin admin = new HBaseAdmin(TESTING_UTIL.getConfiguration());
    // Create table then get the single region for our new table.
    HTableDescriptor htd = new HTableDescriptor(tableName);
    htd.addFamily(new HColumnDescriptor("cf"));
    admin.createTable(htd);

    List<HRegion> regions = null;
    for (int i=0; i<100; i++) {
      regions = cluster.getRegions(tableName);
      if (regions.size() > 0) break;
View Full Code Here

    final byte[] tableName = Bytes.toBytes("testShouldClearRITWhenNodeFoundInSplittingState");
    HBaseAdmin admin = new HBaseAdmin(TESTING_UTIL.getConfiguration());
    // Create table then get the single region for our new table.
    HTableDescriptor htd = new HTableDescriptor(tableName);
    htd.addFamily(new HColumnDescriptor("cf"));
    admin.createTable(htd);
    for (int i = 0; cluster.getRegions(tableName).size() == 0 && i < 100; i++) {
      Thread.sleep(100);
    }
    assertTrue("Table not online", cluster.getRegions(tableName).size() != 0);
View Full Code Here

    HTableDescriptor other = new HTableDescriptor(otherTable);
    other.addFamily(new HColumnDescriptor(family));


    HBaseAdmin admin = UTIL.getHBaseAdmin();
    admin.createTable(primary);
    admin.createTable(other);

    HTable table = new HTable(UTIL.getConfiguration(), "primary");
    Put p = new Put(new byte[] { 'a' });
    p.add(family, null, new byte[] { 'a' });
View Full Code Here

    other.addFamily(new HColumnDescriptor(family));


    HBaseAdmin admin = UTIL.getHBaseAdmin();
    admin.createTable(primary);
    admin.createTable(other);

    HTable table = new HTable(UTIL.getConfiguration(), "primary");
    Put p = new Put(new byte[] { 'a' });
    p.add(family, null, new byte[] { 'a' });
    table.put(p);
View Full Code Here

    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), 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", new KeeperException.SessionExpiredException());
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.