Package org.apache.hadoop.hbase
Class TestRegionRebalancing
java.lang.Object
org.apache.hadoop.hbase.TestRegionRebalancing
Test whether region re-balancing works. (HBASE-71) The test only works for cluster wide
balancing, not per table wide. Increase the margin a little to make StochasticLoadBalancer result
acceptable.
-
Field Summary
Modifier and TypeFieldDescriptionprivate String
static final HBaseClassTestRule
private org.apache.hadoop.hbase.HTableDescriptor
private static final byte[]
private static final org.slf4j.Logger
private org.apache.hadoop.hbase.client.RegionLocator
private final HBaseTestingUtility
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
after()
private void
Determine if regions are balanced.void
before()
static Collection<Object[]>
data()
private List<org.apache.hadoop.hbase.regionserver.HRegionServer>
void
For HBASE-71.private void
Wait until all the regions are assigned.private void
Wait on crash processing.
-
Field Details
-
CLASS_RULE
-
FAMILY_NAME
-
LOG
-
UTIL
-
regionLocator
-
desc
-
balancerName
-
-
Constructor Details
-
TestRegionRebalancing
-
-
Method Details
-
data
-
after
- Throws:
Exception
-
before
- Throws:
Exception
-
testRebalanceOnRegionServerNumberChange
For HBASE-71. Try a few different configurations of starting and stopping region servers to see if the assignment or regions is pretty balanced.- Throws:
IOException
InterruptedException
-
waitOnCrashProcessing
Wait on crash processing. Balancer won't run if processing a crashed server. -
assertRegionsAreBalanced
Determine if regions are balanced. Figure out the total, divide by the number of online servers, then test if each server is +/- 1 of average rounded up.- Throws:
IOException
-
getOnlineRegionServers
-
waitForAllRegionsAssigned
Wait until all the regions are assigned.- Throws:
IOException
-