public class TestAssignmentManager
extends java.lang.Object
AssignmentManager| Modifier and Type | Class and Description |
|---|---|
static class |
TestAssignmentManager.MockedLoadBalancer
Mocked load balancer class used in the testcase to make sure that the testcase waits until
random assignment is called and the gate variable is set to true.
|
| Constructor and Description |
|---|
TestAssignmentManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
after() |
static void |
afterClass() |
void |
before() |
static void |
beforeClass() |
void |
testAssignmentEventIgnoredIfNotExpected()
Test assignment related ZK events are ignored by AM if the region is not known
by AM to be in transition.
|
void |
testAssignmentOfRegionInSSHAndInFailedOpenState() |
void |
testAssignmentOfRegionRITWithOffline() |
void |
testBalance()
Tests AssignmentManager balance function.
|
void |
testBalanceOnMasterFailoverScenarioWithClosedNode() |
void |
testBalanceOnMasterFailoverScenarioWithOfflineNode() |
void |
testBalanceOnMasterFailoverScenarioWithOpenedNode()
Test a balance going on at same time as a master failover
|
void |
testBalanceRegionOfDeletedTable()
If a table is deleted, we should not be able to balance it anymore.
|
void |
testCloseRegionOnAbortingRS()
Tests close region call on a region server that is aborting
|
void |
testCloseRegionOnServerNotOnline()
Tests close region call on a region server that is not in onlineServer list
|
void |
testClosingFailureDuringRecovery()
Scenario:
master starts a close, and creates a znode
it fails just at this moment, before contacting the RS
while the second master is coming up, the targeted RS dies.
|
void |
testDisablingTableRegionsAssignmentDuringCleanClusterStartup()
Test verifies whether assignment is skipped for regions of tables in DISABLING state during
clean cluster startup.
|
void |
testForceAssignMergingRegion() |
void |
testMasterRestartShouldRemoveStaleZnodesOfUnknownTableAsForMeta()
Test verifies whether stale znodes of unknown tables as for the hbase:meta will be removed or
not.
|
void |
testMasterRestartWhenTableInEnabling()
Test verifies whether all the enabling table regions assigned only once during master startup.
|
void |
testOpenCloseRegionRPCIntendedForPreviousServer()
Tests an on-the-fly RPC that was scheduled for the earlier RS on the same port
for openRegion.
|
void |
testProcessDeadServersAndRegionsInTransitionShouldNotFailWithNPE()
Tests the processDeadServersAndRegionsInTransition should not fail with NPE
when it failed to get the children.
|
void |
testRegionInOpeningStateOnDeadRSWhileMasterFailover()
Test the scenario when the master is in failover and trying to process a
region which is in Opening state on a dead RS.
|
void |
testRegionPlanIsUpdatedWhenRegionFailsToOpen()
TestCase verifies that the regionPlan is updated whenever a region fails to open
and the master tries to process RS_ZK_FAILED_OPEN state.(HBASE-5546).
|
void |
testShutdownHandler()
Run a simple server shutdown handler.
|
void |
testShutdownHandlerWithRestartedServer()
Run a simple server shutdown handler after the same server restarts.
|
void |
testSSHTimesOutOpeningRegionTransition()
When a region is in transition, if the region server opening the region goes down,
the region assignment takes a long time normally (waiting for timeout monitor to trigger assign).
|
void |
testSSHWhenDisableTableInProgress()
To test closed region handler to remove rit and delete corresponding znode
if region in pending close or closing while processing shutdown of a region
server.(HBASE-5927).
|
void |
testSSHWhenSplitRegionInProgress()
To test if the split region is removed from RIT if the region was in SPLITTING state but the RS
has actually completed the splitting in hbase:meta but went down.
|
void |
testUnassignWithSplitAtSameTime() |
public static void beforeClass()
throws java.lang.Exception
java.lang.Exceptionpublic static void afterClass()
throws java.io.IOException
java.io.IOExceptionpublic void before()
throws ZooKeeperConnectionException,
java.io.IOException
ZooKeeperConnectionExceptionjava.io.IOExceptionpublic void after()
throws KeeperException,
java.io.IOException
KeeperExceptionjava.io.IOExceptionpublic void testBalanceOnMasterFailoverScenarioWithOpenedNode()
throws java.io.IOException,
KeeperException,
java.lang.InterruptedException,
ServiceException,
DeserializationException,
CoordinatedStateException
java.io.IOExceptionKeeperExceptionjava.lang.InterruptedExceptionDeserializationExceptionServiceExceptionCoordinatedStateExceptionpublic void testBalanceOnMasterFailoverScenarioWithClosedNode()
throws java.io.IOException,
KeeperException,
java.lang.InterruptedException,
ServiceException,
DeserializationException,
CoordinatedStateException
java.io.IOExceptionKeeperExceptionjava.lang.InterruptedExceptionServiceExceptionDeserializationExceptionCoordinatedStateExceptionpublic void testBalanceOnMasterFailoverScenarioWithOfflineNode()
throws java.io.IOException,
KeeperException,
java.lang.InterruptedException,
ServiceException,
DeserializationException,
CoordinatedStateException
java.io.IOExceptionKeeperExceptionjava.lang.InterruptedExceptionServiceExceptionDeserializationExceptionCoordinatedStateExceptionpublic void testBalance()
throws java.io.IOException,
KeeperException,
DeserializationException,
java.lang.InterruptedException,
CoordinatedStateException
java.io.IOExceptionKeeperExceptionDeserializationExceptionjava.lang.InterruptedExceptionCoordinatedStateExceptionpublic void testShutdownHandler()
throws KeeperException,
java.io.IOException,
CoordinatedStateException,
ServiceException
KeeperExceptionjava.io.IOExceptionCoordinatedStateExceptionServiceExceptionpublic void testShutdownHandlerWithRestartedServer()
throws KeeperException,
java.io.IOException,
CoordinatedStateException,
ServiceException
KeeperExceptionjava.io.IOExceptionCoordinatedStateExceptionServiceExceptionpublic void testSSHWhenDisableTableInProgress()
throws KeeperException,
java.io.IOException,
CoordinatedStateException,
ServiceException
KeeperExceptionjava.io.IOExceptionServiceExceptionCoordinatedStateExceptionpublic void testSSHWhenSplitRegionInProgress()
throws KeeperException,
java.io.IOException,
java.lang.Exception
KeeperExceptionjava.io.IOExceptionjava.lang.Exceptionpublic void testUnassignWithSplitAtSameTime()
throws KeeperException,
java.io.IOException,
CoordinatedStateException
KeeperExceptionjava.io.IOExceptionCoordinatedStateExceptionpublic void testProcessDeadServersAndRegionsInTransitionShouldNotFailWithNPE()
throws java.io.IOException,
KeeperException,
CoordinatedStateException,
java.lang.InterruptedException,
ServiceException
ServiceExceptionjava.io.IOExceptionKeeperExceptionCoordinatedStateExceptionjava.lang.InterruptedExceptionpublic void testRegionPlanIsUpdatedWhenRegionFailsToOpen()
throws java.io.IOException,
KeeperException,
ServiceException,
java.lang.InterruptedException,
CoordinatedStateException
java.io.IOExceptionKeeperExceptionServiceExceptionjava.lang.InterruptedExceptionCoordinatedStateExceptionpublic void testAssignmentOfRegionInSSHAndInFailedOpenState()
throws java.io.IOException,
KeeperException,
ServiceException,
CoordinatedStateException,
java.lang.InterruptedException
java.io.IOExceptionKeeperExceptionServiceExceptionCoordinatedStateExceptionjava.lang.InterruptedExceptionpublic void testAssignmentOfRegionRITWithOffline()
throws java.io.IOException,
KeeperException,
ServiceException,
CoordinatedStateException,
java.lang.InterruptedException
java.io.IOExceptionKeeperExceptionServiceExceptionCoordinatedStateExceptionjava.lang.InterruptedExceptionpublic void testRegionInOpeningStateOnDeadRSWhileMasterFailover()
throws java.io.IOException,
KeeperException,
ServiceException,
CoordinatedStateException,
java.lang.InterruptedException
java.io.IOExceptionKeeperExceptionServiceExceptionCoordinatedStateExceptionjava.lang.InterruptedExceptionpublic void testDisablingTableRegionsAssignmentDuringCleanClusterStartup()
throws KeeperException,
java.io.IOException,
java.lang.Exception
KeeperExceptionjava.io.IOExceptionjava.lang.Exceptionpublic void testMasterRestartWhenTableInEnabling()
throws KeeperException,
java.io.IOException,
java.lang.Exception
KeeperExceptionjava.io.IOExceptionjava.lang.Exceptionpublic void testMasterRestartShouldRemoveStaleZnodesOfUnknownTableAsForMeta()
throws java.lang.Exception
KeeperExceptionjava.io.IOExceptionjava.lang.Exceptionpublic void testSSHTimesOutOpeningRegionTransition()
throws KeeperException,
java.io.IOException,
CoordinatedStateException,
ServiceException
KeeperExceptionjava.io.IOExceptionCoordinatedStateExceptionServiceExceptionpublic void testClosingFailureDuringRecovery()
throws java.lang.Exception
java.lang.Exceptionpublic void testForceAssignMergingRegion()
throws java.lang.Exception
java.lang.Exceptionpublic void testAssignmentEventIgnoredIfNotExpected()
throws KeeperException,
java.io.IOException,
CoordinatedStateException
KeeperExceptionjava.io.IOExceptionCoordinatedStateExceptionpublic void testBalanceRegionOfDeletedTable()
throws java.lang.Exception
java.lang.Exceptionpublic void testOpenCloseRegionRPCIntendedForPreviousServer()
throws java.lang.Exception
java.lang.Exceptionpublic void testCloseRegionOnAbortingRS()
throws java.lang.Exception
java.lang.Exceptionpublic void testCloseRegionOnServerNotOnline()
throws java.lang.Exception
java.lang.Exception