Package org.apache.hadoop.hbase.client

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


    table.put(new Put(Bytes.toBytes("row1"))
        .add(TEST_FAMILY, TEST_QUALIFIER, Bytes.toBytes("v1")));
    table.put(new Put(Bytes.toBytes("row2"))
        .add(TEST_FAMILY, TEST_QUALIFIER, Bytes.toBytes("v2")));
    HBaseAdmin admin = UTIL.getHBaseAdmin();
    admin.split(TEST_TABLE);

    // wait for split
    Thread.sleep(10000);

    ListMultimap<String,TablePermission> postperms =
View Full Code Here


            byte[] tableName = Bytes.toBytes(ATABLE_NAME);
            admin = conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
            HTable htable = (HTable)conn.unwrap(PhoenixConnection.class).getQueryServices().getTable(tableName);
            htable.clearRegionCache();
            int nRegions = htable.getRegionLocations().size();
            admin.split(tableName, ByteUtil.concat(Bytes.toBytes(tenantId), Bytes.toBytes("00A" + Character.valueOf((char)('3' + nextRunCount()))+ ts))); // vary split point with test run
            int retryCount = 0;
            do {
                Thread.sleep(2000);
                retryCount++;
                //htable.clearRegionCache();
View Full Code Here

       
        byte[][] internalSplitKeys = BackfillUtil.getSplitKeys(hTable.getStartEndKeys());
        List<Scan> scans = HBaseBackfillMerger.scansThisCubeOnly(new byte[] {}, internalSplitKeys);
        Assert.assertEquals(1, scans.size());
       
        admin.split(tableName, "d".getBytes());
        Thread.sleep(5000L); // hack: wait for split to happen
        admin.split(tableName, "c01".getBytes());
        Thread.sleep(5000L); // hack: wait for split to happen
        Pair<byte[][],byte[][]> startsEnds = hTable.getStartEndKeys();
        Assert.assertEquals("Regions didn't split as requested, wtf", 3, startsEnds.getFirst().length);
View Full Code Here

        List<Scan> scans = HBaseBackfillMerger.scansThisCubeOnly(new byte[] {}, internalSplitKeys);
        Assert.assertEquals(1, scans.size());
       
        admin.split(tableName, "d".getBytes());
        Thread.sleep(5000L); // hack: wait for split to happen
        admin.split(tableName, "c01".getBytes());
        Thread.sleep(5000L); // hack: wait for split to happen
        Pair<byte[][],byte[][]> startsEnds = hTable.getStartEndKeys();
        Assert.assertEquals("Regions didn't split as requested, wtf", 3, startsEnds.getFirst().length);
        internalSplitKeys = BackfillUtil.getSplitKeys(startsEnds);
        scans = HBaseBackfillMerger.scansThisCubeOnly(new byte[] {}, internalSplitKeys);
View Full Code Here

    helper.dump("testtable",
      new String[]{"row1", "row2", "row3", "row4", "row5"},
      null, null);
    HBaseAdmin admin = new HBaseAdmin(conf);
    try {
      admin.split("testtable", "row3");
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    HTable table = new HTable(conf, "testtable");
    // wait for the split to be done
View Full Code Here

    helper.dump("testtable",
      new String[]{"row1", "row2", "row3", "row4", "row5"},
      null, null);
    HBaseAdmin admin = new HBaseAdmin(conf);
    try {
      admin.split("testtable", "row3");
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    // vv EndpointExample
    HTable table = new HTable(conf, "testtable");
View Full Code Here

    helper.dump("testtable",
      new String[]{"row1", "row2", "row3", "row4", "row5"},
      null, null);
    HBaseAdmin admin = new HBaseAdmin(conf);
    try {
      admin.split("testtable", "row3");
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    HTable table = new HTable(conf, "testtable");
    while (table.getRegionsInfo().size() < 2)
View Full Code Here

    helper.dump("testtable",
      new String[]{"row1", "row2", "row3", "row4", "row5"},
      null, null);
    HBaseAdmin admin = new HBaseAdmin(conf);
    try {
      admin.split("testtable", "row3");
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    HTable table = new HTable(conf, "testtable");
    // wait for the split to be done
View Full Code Here

    CountDownLatch proceed = new CountDownLatch(1);
    RegionOpenListener list = new RegionOpenListener(aboutToOpen, proceed);
    HBaseEventHandler.registerListener(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

            byte[] tableName = Bytes.toBytes(ATABLE_NAME);
            admin = conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
            HTable htable = (HTable)conn.unwrap(PhoenixConnection.class).getQueryServices().getTable(tableName);
            htable.clearRegionCache();
            int nRegions = htable.getRegionLocations().size();
            admin.split(tableName, ByteUtil.concat(Bytes.toBytes(tenantId), Bytes.toBytes("00A" + Character.valueOf((char)('3' + nextRunCount()))+ ts))); // vary split point with test run
            int retryCount = 0;
            do {
                Thread.sleep(2000);
                retryCount++;
                //htable.clearRegionCache();
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.