public class TestRegionSplitter extends Object
RegionSplitter
, which can create a pre-split table or do a
rolling split of an existing table.Modifier and Type | Field and Description |
---|---|
private static String |
CF_NAME |
static HBaseClassTestRule |
CLASS_RULE |
private static org.slf4j.Logger |
LOG |
org.junit.rules.TestName |
name |
private static HBaseTestingUtility |
UTIL |
private static byte |
xFF |
Constructor and Description |
---|
TestRegionSplitter() |
Modifier and Type | Method and Description |
---|---|
private static int |
indexOfBytes(List<byte[]> list,
byte[] compareTo)
List.indexOf() doesn't really work for a List<byte[]>, because byte[]
doesn't override equals().
|
void |
noopRollingSplit() |
private void |
preSplitTableAndVerify(List<byte[]> expectedBounds,
String splitClass,
org.apache.hadoop.hbase.TableName tableName)
Creates a pre-split table with expectedBounds.size()+1 regions, then
verifies that the region boundaries are the same as the expected
region boundaries in expectedBounds.
|
private void |
rollingSplitAndVerify(org.apache.hadoop.hbase.TableName tableName,
String splitClass,
List<byte[]> expectedBounds) |
static void |
setup() |
private boolean |
splitFailsPrecondition(org.apache.hadoop.hbase.util.RegionSplitter.SplitAlgorithm algo) |
private boolean |
splitFailsPrecondition(org.apache.hadoop.hbase.util.RegionSplitter.SplitAlgorithm algo,
int numRegions) |
private boolean |
splitFailsPrecondition(org.apache.hadoop.hbase.util.RegionSplitter.SplitAlgorithm algo,
String firstRow,
String lastRow) |
private boolean |
splitFailsPrecondition(org.apache.hadoop.hbase.util.RegionSplitter.SplitAlgorithm algo,
String firstRow,
String lastRow,
int numRegions) |
static void |
teardown() |
void |
testCreatePresplitTableHex()
Test creating a pre-split table using the HexStringSplit algorithm.
|
void |
testCreatePresplitTableUniform()
Test creating a pre-split table using the UniformSplit algorithm.
|
void |
testUserInput() |
void |
unitTestDecimalStringSplit()
Unit tests for the DecimalStringSplit algorithm.
|
void |
unitTestHexStringSplit()
Unit tests for the HexStringSplit algorithm.
|
void |
unitTestUniformSplit()
Unit tests for the UniformSplit algorithm.
|
private void |
verifyBounds(List<byte[]> expectedBounds,
org.apache.hadoop.hbase.TableName tableName) |
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static final HBaseTestingUtility UTIL
private static final String CF_NAME
private static final byte xFF
public org.junit.rules.TestName name
public TestRegionSplitter()
public void testCreatePresplitTableHex() throws Exception
Exception
public void testCreatePresplitTableUniform() throws Exception
Exception
public void unitTestHexStringSplit()
public void unitTestDecimalStringSplit()
public void unitTestUniformSplit()
public void testUserInput()
private boolean splitFailsPrecondition(org.apache.hadoop.hbase.util.RegionSplitter.SplitAlgorithm algo)
private boolean splitFailsPrecondition(org.apache.hadoop.hbase.util.RegionSplitter.SplitAlgorithm algo, String firstRow, String lastRow)
private boolean splitFailsPrecondition(org.apache.hadoop.hbase.util.RegionSplitter.SplitAlgorithm algo, String firstRow, String lastRow, int numRegions)
private boolean splitFailsPrecondition(org.apache.hadoop.hbase.util.RegionSplitter.SplitAlgorithm algo, int numRegions)
private void preSplitTableAndVerify(List<byte[]> expectedBounds, String splitClass, org.apache.hadoop.hbase.TableName tableName) throws Exception
Various
- junit assertionsException
public void noopRollingSplit() throws Exception
Exception
private void rollingSplitAndVerify(org.apache.hadoop.hbase.TableName tableName, String splitClass, List<byte[]> expectedBounds) throws Exception
Exception
private void verifyBounds(List<byte[]> expectedBounds, org.apache.hadoop.hbase.TableName tableName) throws Exception
Exception
private static int indexOfBytes(List<byte[]> list, byte[] compareTo)
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.