Class TestSplitTransactionOnCluster
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestSplitTransactionOnCluster
The below tests are testing split region against a running cluster
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
static class
static class
(package private) static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.client.Admin
static final HBaseClassTestRule
private SingleProcessHBaseCluster
private static final org.slf4j.Logger
org.junit.rules.TestName
private static final int
(package private) static final HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.master.HMaster
static void
after()
private void
awaitDaughters
(org.apache.hadoop.hbase.TableName tableName, int numDaughters) private List<org.apache.hadoop.hbase.regionserver.HRegion>
awaitTableRegions
(org.apache.hadoop.hbase.TableName tableName) static void
before()
private List<org.apache.hadoop.hbase.regionserver.HRegion>
checkAndGetDaughters
(org.apache.hadoop.hbase.TableName tableName) private void
clearReferences
(org.apache.hadoop.hbase.regionserver.HRegion region) private org.apache.hadoop.hbase.client.Table
createTableAndWait
(org.apache.hadoop.hbase.TableName tableName, byte[] cf) private int
ensureTableRegionNotOnSameServerAsMeta
(org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.client.RegionInfo hri) Ensure single table region is not on same server as the single hbase:meta table region.private void
findRegionToSplit
(org.apache.hadoop.hbase.TableName tableName, String splitRowKey) private org.apache.hadoop.hbase.regionserver.HRegion
findSplittableRegion
(List<org.apache.hadoop.hbase.regionserver.HRegion> regions) private org.apache.hadoop.hbase.client.RegionInfo
getAndCheckSingleTableRegion
(List<org.apache.hadoop.hbase.regionserver.HRegion> regions) private org.apache.hadoop.hbase.regionserver.HRegionServer
getOtherRegionServer
(SingleProcessHBaseCluster cluster, org.apache.hadoop.hbase.regionserver.HRegionServer notThisOne) Find regionserver other than the one passed.private void
insertData
(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.client.Table t) private void
insertData
(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.client.Table t, int i) private void
printOutRegions
(org.apache.hadoop.hbase.regionserver.HRegionServer hrs, String prefix) private void
requestSplitRegion
(org.apache.hadoop.hbase.regionserver.HRegionServer rsServer, org.apache.hadoop.hbase.regionserver.Region region, byte[] midKey) private static void
scanValidate
(org.apache.hadoop.hbase.client.Scan scan, int expectedRowCount, org.apache.hadoop.hbase.client.Table table) void
setup()
void
tearDown()
void
void
Verifies HBASE-5806.void
void
Test that if daughter split on us, we won't do the shutdown handler fixup just because we can't find the immediate daughter of an offlined parent.void
void
void
If a table has regions that have no store files in a region, they should split successfully into two regions with no store files.void
void
void
void
private void
-
Field Details
-
CLASS_RULE
-
LOG
-
admin
-
cluster
-
NB_SERVERS
- See Also:
-
TESTING_UTIL
-
name
-
-
Constructor Details
-
TestSplitTransactionOnCluster
public TestSplitTransactionOnCluster()
-
-
Method Details
-
before
- Throws:
Exception
-
after
- Throws:
Exception
-
setup
- Throws:
IOException
-
tearDown
- Throws:
Exception
-
getAndCheckSingleTableRegion
private org.apache.hadoop.hbase.client.RegionInfo getAndCheckSingleTableRegion(List<org.apache.hadoop.hbase.regionserver.HRegion> regions) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
requestSplitRegion
private void requestSplitRegion(org.apache.hadoop.hbase.regionserver.HRegionServer rsServer, org.apache.hadoop.hbase.regionserver.Region region, byte[] midKey) throws IOException - Throws:
IOException
-
testRITStateForRollback
- Throws:
Exception
-
testSplitFailedCompactionAndSplit
- Throws:
Exception
-
testSplitCompactWithPriority
- Throws:
Exception
-
testContinuousSplitUsingLinkFile
- Throws:
Exception
-
findRegionToSplit
private void findRegionToSplit(org.apache.hadoop.hbase.TableName tableName, String splitRowKey) throws Exception - Throws:
Exception
-
scanValidate
private static void scanValidate(org.apache.hadoop.hbase.client.Scan scan, int expectedRowCount, org.apache.hadoop.hbase.client.Table table) throws IOException - Throws:
IOException
-
testSplitRollbackOnRegionClosing
- Throws:
Exception
-
testShutdownFixupWhenDaughterHasSplit
Test that if daughter split on us, we won't do the shutdown handler fixup just because we can't find the immediate daughter of an offlined parent.- Throws:
Exception
-
clearReferences
private void clearReferences(org.apache.hadoop.hbase.regionserver.HRegion region) throws IOException - Throws:
IOException
-
testSplitShouldNotThrowNPEEvenARegionHasEmptySplitFiles
- Throws:
Exception
-
testMasterRestartAtRegionSplitPendingCatalogJanitor
public void testMasterRestartAtRegionSplitPendingCatalogJanitor() throws IOException, InterruptedException, org.apache.zookeeper.KeeperException.NodeExistsException, org.apache.zookeeper.KeeperException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException, ExecutionException, TimeoutExceptionVerifies HBASE-5806. Here the case is that splitting is completed but before the CJ could remove the parent region the master is killed and restarted.- Throws:
IOException
InterruptedException
org.apache.zookeeper.KeeperException.NodeExistsException
org.apache.zookeeper.KeeperException
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
ExecutionException
TimeoutException
-
testSplitWithRegionReplicas
- Throws:
Exception
-
insertData
private void insertData(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.client.Table t) throws IOException - Throws:
IOException
-
insertData
private void insertData(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.client.Table t, int i) throws IOException - Throws:
IOException
-
testSplitRegionWithNoStoreFiles
If a table has regions that have no store files in a region, they should split successfully into two regions with no store files.- Throws:
Exception
-
testStoreFileReferenceCreationWhenSplitPolicySaysToSkipRangeCheck
- Throws:
Exception
-
findSplittableRegion
private org.apache.hadoop.hbase.regionserver.HRegion findSplittableRegion(List<org.apache.hadoop.hbase.regionserver.HRegion> regions) throws InterruptedException - Throws:
InterruptedException
-
checkAndGetDaughters
private List<org.apache.hadoop.hbase.regionserver.HRegion> checkAndGetDaughters(org.apache.hadoop.hbase.TableName tableName) throws InterruptedException - Throws:
InterruptedException
-
abortAndWaitForMaster
private org.apache.hadoop.hbase.master.HMaster abortAndWaitForMaster() throws IOException, InterruptedException- Throws:
IOException
InterruptedException
-
ensureTableRegionNotOnSameServerAsMeta
private int ensureTableRegionNotOnSameServerAsMeta(org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.client.RegionInfo hri) throws IOException, org.apache.hadoop.hbase.MasterNotRunningException, org.apache.hadoop.hbase.ZooKeeperConnectionException, InterruptedException Ensure single table region is not on same server as the single hbase:meta table region.- Returns:
- Index of the server hosting the single table region
- Throws:
IOException
org.apache.hadoop.hbase.MasterNotRunningException
org.apache.hadoop.hbase.ZooKeeperConnectionException
InterruptedException
-
getOtherRegionServer
private org.apache.hadoop.hbase.regionserver.HRegionServer getOtherRegionServer(SingleProcessHBaseCluster cluster, org.apache.hadoop.hbase.regionserver.HRegionServer notThisOne) Find regionserver other than the one passed. Can't rely on indexes into list of regionservers since crashed servers occupy an index.- Returns:
- A regionserver that is not
notThisOne
or null if none found
-
printOutRegions
private void printOutRegions(org.apache.hadoop.hbase.regionserver.HRegionServer hrs, String prefix) throws IOException - Throws:
IOException
-
waitUntilRegionServerDead
- Throws:
InterruptedException
IOException
-
awaitDaughters
private void awaitDaughters(org.apache.hadoop.hbase.TableName tableName, int numDaughters) throws InterruptedException - Throws:
InterruptedException
-
awaitTableRegions
private List<org.apache.hadoop.hbase.regionserver.HRegion> awaitTableRegions(org.apache.hadoop.hbase.TableName tableName) throws InterruptedException - Throws:
InterruptedException
-
createTableAndWait
private org.apache.hadoop.hbase.client.Table createTableAndWait(org.apache.hadoop.hbase.TableName tableName, byte[] cf) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-