Class TestRegionMergeTransactionOnCluster
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestRegionMergeTransactionOnCluster
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
(package private) static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static org.apache.hadoop.hbase.client.Admin
static final HBaseClassTestRule
private static final byte[]
private static final int
private static final org.slf4j.Logger
private static org.apache.hadoop.hbase.master.HMaster
org.junit.rules.TestName
private static final int
private static final byte[]
private static byte[]
private static byte[][]
private static final int
(package private) static final HBaseTestingUtil
private static int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
private org.apache.hadoop.hbase.client.Table
createTableAndLoadData
(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tablename) private org.apache.hadoop.hbase.client.Table
createTableAndLoadData
(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tablename, int numRegions, int replication) private void
loadData
(org.apache.hadoop.hbase.client.Table table) private static byte[][]
makeN
(byte[] base, int n) private org.apache.hadoop.hbase.util.PairOfSameType<org.apache.hadoop.hbase.client.RegionInfo>
mergeRegionsAndVerifyRegionNum
(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tablename, int regionAnum, int regionBnum, int expectedRegionNum) private org.apache.hadoop.hbase.util.PairOfSameType<org.apache.hadoop.hbase.client.RegionInfo>
requestMergeRegion
(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tablename, int regionAnum, int regionBnum) void
void
This test tests 1, merging region not online; 2, merging same two regions; 3, merging unknown regions.void
Not really restarting the master.void
void
private void
verifyRowCount
(org.apache.hadoop.hbase.client.Table table, int expectedRegionNum) private void
waitAndVerifyRegionNum
(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tablename, int expectedRegionNum)
-
Field Details
-
CLASS_RULE
-
LOG
-
name
-
NB_SERVERS
- See Also:
-
FAMILYNAME
-
QUALIFIER
-
ROW
-
INITIAL_REGION_NUM
- See Also:
-
ROWSIZE
- See Also:
-
ROWS
-
waitTime
-
TEST_UTIL
-
MASTER
-
ADMIN
-
-
Constructor Details
-
TestRegionMergeTransactionOnCluster
public TestRegionMergeTransactionOnCluster()
-
-
Method Details
-
beforeAllTests
- Throws:
Exception
-
afterAllTests
- Throws:
Exception
-
testWholesomeMerge
- Throws:
Exception
-
testMergeAndRestartingMaster
Not really restarting the master. Simulate it by clear of new region state since it is not persisted, will be lost after master restarts.- Throws:
Exception
-
testCleanMergeReference
- Throws:
Exception
-
testMerge
This test tests 1, merging region not online; 2, merging same two regions; 3, merging unknown regions. They are in one test case so that we don't have to create many tables, and these tests are simple.- Throws:
Exception
-
testMergeWithReplicas
- Throws:
Exception
-
mergeRegionsAndVerifyRegionNum
private org.apache.hadoop.hbase.util.PairOfSameType<org.apache.hadoop.hbase.client.RegionInfo> mergeRegionsAndVerifyRegionNum(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tablename, int regionAnum, int regionBnum, int expectedRegionNum) throws Exception - Throws:
Exception
-
requestMergeRegion
private org.apache.hadoop.hbase.util.PairOfSameType<org.apache.hadoop.hbase.client.RegionInfo> requestMergeRegion(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tablename, int regionAnum, int regionBnum) throws Exception - Throws:
Exception
-
waitAndVerifyRegionNum
private void waitAndVerifyRegionNum(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tablename, int expectedRegionNum) throws Exception - Throws:
Exception
-
createTableAndLoadData
private org.apache.hadoop.hbase.client.Table createTableAndLoadData(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tablename) throws Exception - Throws:
Exception
-
createTableAndLoadData
private org.apache.hadoop.hbase.client.Table createTableAndLoadData(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tablename, int numRegions, int replication) throws Exception - Throws:
Exception
-
makeN
-
loadData
- Throws:
IOException
-
verifyRowCount
private void verifyRowCount(org.apache.hadoop.hbase.client.Table table, int expectedRegionNum) throws IOException - Throws:
IOException
-