Package org.apache.hadoop.hbase.client

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


      HRegionInfo hri = location.getRegionInfo();

      // do a regular split
      HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
      byte[] regionName = location.getRegionInfo().getRegionName();
      admin.split(location.getRegionInfo().getRegionName(), Bytes.toBytes("BM"));
      TestEndToEndSplitTransaction.blockUntilRegionSplit(
          TEST_UTIL.getConfiguration(), 60000, regionName, true);

      PairOfSameType<HRegionInfo> daughters = MetaReader.getDaughterRegions(meta.get(new Get(regionName)));
View Full Code Here


        String tableName = "RegionSplitTest".toUpperCase();

        HBaseAdmin admin = HBaseUtils.getHBaseAdmin();
        //admin.getConnection().clearRegionCache();
        admin.split(Bytes.toBytes(tableName), Bytes.toBytes(10));

        for (int i = 1; i < size; i++)
            stmt.executeUpdate("INSERT INTO RegionSplitTest(id, name) VALUES(" + i + ", 'a1')");

        //admin.getConnection().clearRegionCache();
View Full Code Here

        for (int i = 1; i < size; i++)
            stmt.executeUpdate("INSERT INTO RegionSplitTest(id, name) VALUES(" + i + ", 'a1')");

        //admin.getConnection().clearRegionCache();
        Thread.sleep(2000);
        admin.split(Bytes.toBytes(tableName), Bytes.toBytes(30));

        sql = "select id, name from RegionSplitTest";
        printResultSet();

        for (int i = 1; i < size; i++)
View Full Code Here

        for (int i = 1; i < size; i++)
            stmt.executeUpdate("INSERT INTO RegionSplitTest(id, name) VALUES(" + i + ", 'a1')");

        //admin.getConnection().clearRegionCache();
        Thread.sleep(2000);
        admin.split(Bytes.toBytes(tableName), Bytes.toBytes(40));

        sql = "select id, name from RegionSplitTest";
        printResultSet();
    }
View Full Code Here

        String tableName = "SplitTest".toUpperCase();
        printRegions(tableName);

        HBaseAdmin admin = HBaseUtils.getHBaseAdmin();
        admin.split(Bytes.toBytes(tableName), Bytes.toBytes(20));
        Thread.sleep(2000);

        admin.split(Bytes.toBytes(tableName), Bytes.toBytes(40));
        Thread.sleep(2000);
View Full Code Here

        HBaseAdmin admin = HBaseUtils.getHBaseAdmin();
        admin.split(Bytes.toBytes(tableName), Bytes.toBytes(20));
        Thread.sleep(2000);

        admin.split(Bytes.toBytes(tableName), Bytes.toBytes(40));
        Thread.sleep(2000);

        admin.balancer();
        Thread.sleep(2000);
View Full Code Here

          // we have a good region, time to split!
          byte[] split = dr.getSecond();
          LOG.debug("Splitting at " + splitAlgo.rowToStr(split));
          HBaseAdmin admin = new HBaseAdmin(table.getConfiguration());
          admin.split(table.getTableName(), split);

          LinkedList<Pair<byte[], byte[]>> finished = Lists.newLinkedList();
          if (conf.getBoolean("split.verify", true)) {
            // we need to verify and rate-limit our splits
            outstanding.addLast(dr);
View Full Code Here

    table.flushCommits();
    // get the initial layout (should just be one region)
    Map<HRegionInfo,HServerAddress> m = table.getRegionsInfo();
    assertEquals(m.size(), 1);
    // tell the master to split the table
    admin.split(TABLE);
    // give some time for the split to happen

    long timeout = System.currentTimeMillis() + (15 * 1000);
    while (System.currentTimeMillis() < timeout && m.size()!=2){
      try {
View Full Code Here

    CountDownLatch proceed = new CountDownLatch(1);
    RegionOpenListener list = new RegionOpenListener(aboutToOpen, proceed);
    m.getRegionServerOperationQueue().registerRegionServerOperationListener(list);

    LOG.info("Splitting table");
    admin.split(TABLENAME);
    LOG.info("Waiting for split result to be about to open");
    aboutToOpen.await(60, TimeUnit.SECONDS);
    try {
      LOG.info("Making sure we can call getTableRegions while opening");
      tableRegions = m.getTableRegions(TABLENAME);
View Full Code Here

        UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager()
            .getRegionsOfTable(userTableName.getBytes());
    HRegionInfo hRegionInfo = regionsOfTable.get(0);
    hRegionInfo.getRegionName();
    HTable tableidx = new HTable(conf, userTableName + "_idx");
    admin.split(hRegionInfo.getRegionName(), "row6".getBytes());
    String indexTable = userTableName + "_idx";
    List<HRegionInfo> mainTableRegions =
        UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager()
            .getRegionsOfTable(userTableName.getBytes());
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.