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
Nested ClassesModifier and TypeClassDescription(package private) static classstatic classstatic class(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.client.Adminstatic final HBaseClassTestRuleprivate MiniHBaseClusterprivate static final org.slf4j.Loggerorg.junit.rules.TestNameprivate static final int(package private) static final HBaseTestingUtility -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.master.HMasterstatic voidafter()private voidawaitDaughters(org.apache.hadoop.hbase.TableName tableName, int numDaughters) private List<org.apache.hadoop.hbase.regionserver.HRegion>awaitTableRegions(org.apache.hadoop.hbase.TableName tableName) static voidbefore()private List<org.apache.hadoop.hbase.regionserver.HRegion>checkAndGetDaughters(org.apache.hadoop.hbase.TableName tableName) private voidclearReferences(org.apache.hadoop.hbase.regionserver.HRegion region) private org.apache.hadoop.hbase.client.TablecreateTableAndWait(org.apache.hadoop.hbase.TableName tableName, byte[] cf) private intensureTableRegionNotOnSameServerAsMeta(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 voidfindRegionToSplit(org.apache.hadoop.hbase.TableName tableName, String splitRowKey) private org.apache.hadoop.hbase.regionserver.HRegionfindSplittableRegion(List<org.apache.hadoop.hbase.regionserver.HRegion> regions) private org.apache.hadoop.hbase.client.RegionInfogetAndCheckSingleTableRegion(List<org.apache.hadoop.hbase.regionserver.HRegion> regions) private org.apache.hadoop.hbase.regionserver.HRegionServergetOtherRegionServer(MiniHBaseCluster cluster, org.apache.hadoop.hbase.regionserver.HRegionServer notThisOne) Find regionserver other than the one passed.private voidinsertData(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.client.Table t) private voidinsertData(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.client.Table t, int i) private voidprintOutRegions(org.apache.hadoop.hbase.regionserver.HRegionServer hrs, String prefix) private voidrequestSplitRegion(org.apache.hadoop.hbase.regionserver.HRegionServer rsServer, org.apache.hadoop.hbase.regionserver.Region region, byte[] midKey) private static voidscanValidate(org.apache.hadoop.hbase.client.Scan scan, int expectedRowCount, org.apache.hadoop.hbase.client.Table table) voidsetup()voidtearDown()voidvoidVerifies HBASE-5806.voidvoidTest 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.voidvoidvoidIf a table has regions that have no store files in a region, they should split successfully into two regions with no store files.voidvoidvoidvoidprivate 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:
IOExceptionInterruptedException
-
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:
IOExceptionInterruptedExceptionorg.apache.zookeeper.KeeperException.NodeExistsExceptionorg.apache.zookeeper.KeeperExceptionorg.apache.hbase.thirdparty.com.google.protobuf.ServiceExceptionExecutionExceptionTimeoutException
-
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:
IOExceptionInterruptedException
-
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:
IOExceptionorg.apache.hadoop.hbase.MasterNotRunningExceptionorg.apache.hadoop.hbase.ZooKeeperConnectionExceptionInterruptedException
-
getOtherRegionServer
private org.apache.hadoop.hbase.regionserver.HRegionServer getOtherRegionServer(MiniHBaseCluster 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
notThisOneor null if none found
-
printOutRegions
private void printOutRegions(org.apache.hadoop.hbase.regionserver.HRegionServer hrs, String prefix) throws IOException - Throws:
IOException
-
waitUntilRegionServerDead
- Throws:
InterruptedExceptionIOException
-
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:
IOExceptionInterruptedException
-