Package org.apache.hadoop.hbase.util.RegionSplitter

Examples of org.apache.hadoop.hbase.util.RegionSplitter.SplitAlgorithm


    @Override
    public void run() {
      long startTime, endTime;
      HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(TABLE_NAME));
      desc.addFamily(new HColumnDescriptor(COLUMN_NAME));
      SplitAlgorithm algo = new RegionSplitter.HexStringSplit();
      byte[][] splits = algo.split(REGION_COUNT);

      LOG.info(String.format("Creating table %s with %d splits.",
        TABLE_NAME, REGION_COUNT));
      startTime = System.currentTimeMillis();
      try {
View Full Code Here


    @Override
    public void run() {
      long startTime, endTime;
      HTableDescriptor desc = new HTableDescriptor(TABLE_NAME);
      desc.addFamily(new HColumnDescriptor(COLUMN_NAME));
      SplitAlgorithm algo = new RegionSplitter.HexStringSplit();
      byte[][] splits = algo.split(REGION_COUNT);

      LOG.info(String.format("Creating table %s with %d splits.",
        TABLE_NAME, REGION_COUNT));
      startTime = System.currentTimeMillis();
      try {
View Full Code Here

    @Override
    public void run() {
      long startTime, endTime;
      HTableDescriptor desc = new HTableDescriptor(TABLE_NAME);
      desc.addFamily(new HColumnDescriptor(COLUMN_NAME));
      SplitAlgorithm algo = new RegionSplitter.HexStringSplit();
      byte[][] splits = algo.split(REGION_COUNT);

      LOG.info(String.format("Creating table %s with %d splits.",
        TABLE_NAME, REGION_COUNT));
      startTime = System.currentTimeMillis();
      try {
View Full Code Here

                new byte[] {(byte)0xef, xFF, xFF, xFF, xFF, xFF, xFF, xFF});
    }

  @Test
  public void testUserInput() {
    SplitAlgorithm algo = new HexStringSplit();
    assertFalse(splitFailsPrecondition(algo)); // default settings are fine
    assertFalse(splitFailsPrecondition(algo, "00", "AA")); // custom is fine
    assertTrue(splitFailsPrecondition(algo, "AA", "00")); // range error
    assertTrue(splitFailsPrecondition(algo, "AA", "AA")); // range error
    assertFalse(splitFailsPrecondition(algo, "0", "2", 3)); // should be fine
View Full Code Here

    private void preSplitTableAndVerify(List<byte[]> expectedBounds,
            String splitClass, String tableName) throws Exception {
        final int numRegions = expectedBounds.size()-1;
        final Configuration conf = UTIL.getConfiguration();
        conf.setInt("split.count", numRegions);
        SplitAlgorithm splitAlgo = RegionSplitter.newSplitAlgoInstance(conf, splitClass);
        RegionSplitter.createPresplitTable(tableName, splitAlgo,
                new String[] {CF_NAME}, conf);
        verifyBounds(expectedBounds, tableName);
    }
View Full Code Here

            List<byte[]> expectedBoundsthrows Exception {
        final Configuration conf = UTIL.getConfiguration();

        // Set this larger than the number of splits so RegionSplitter won't block
        conf.setInt("split.outstanding", 5);
        SplitAlgorithm splitAlgo = RegionSplitter.newSplitAlgoInstance(conf, splitClass);
        RegionSplitter.rollingSplit(tableName, splitAlgo, conf);
        verifyBounds(expectedBounds, tableName);
    }
View Full Code Here

                new byte[] {(byte)0xef, xFF, xFF, xFF, xFF, xFF, xFF, xFF});
    }

  @Test
  public void testUserInput() {
    SplitAlgorithm algo = new HexStringSplit();
    assertFalse(splitFailsPrecondition(algo)); // default settings are fine
    assertFalse(splitFailsPrecondition(algo, "00", "AA")); // custom is fine
    assertTrue(splitFailsPrecondition(algo, "AA", "00")); // range error
    assertTrue(splitFailsPrecondition(algo, "AA", "AA")); // range error
    assertFalse(splitFailsPrecondition(algo, "0", "2", 3)); // should be fine
View Full Code Here

    private void preSplitTableAndVerify(List<byte[]> expectedBounds,
            String splitClass, TableName tableName) throws Exception {
        final int numRegions = expectedBounds.size()-1;
        final Configuration conf = UTIL.getConfiguration();
        conf.setInt("split.count", numRegions);
        SplitAlgorithm splitAlgo = RegionSplitter.newSplitAlgoInstance(conf, splitClass);
        RegionSplitter.createPresplitTable(tableName, splitAlgo, new String[] {CF_NAME}, conf);
        verifyBounds(expectedBounds, tableName);
    }
View Full Code Here

            List<byte[]> expectedBoundsthrows Exception {
        final Configuration conf = UTIL.getConfiguration();

        // Set this larger than the number of splits so RegionSplitter won't block
        conf.setInt("split.outstanding", 5);
        SplitAlgorithm splitAlgo = RegionSplitter.newSplitAlgoInstance(conf, splitClass);
        RegionSplitter.rollingSplit(tableName, splitAlgo, conf);
        verifyBounds(expectedBounds, tableName);
    }
View Full Code Here

    @Override
    public void run() {
      long startTime, endTime;
      HTableDescriptor desc = new HTableDescriptor(TABLE_NAME);
      desc.addFamily(new HColumnDescriptor(COLUMN_NAME));
      SplitAlgorithm algo = new RegionSplitter.HexStringSplit();
      byte[][] splits = algo.split(REGION_COUNT);

      LOG.info(String.format("Creating table %s with %d splits.",
        TABLE_NAME, REGION_COUNT));
      startTime = System.currentTimeMillis();
      try {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.util.RegionSplitter.SplitAlgorithm

Copyright © 2018 www.massapicom. 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.