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
FieldsModifier and TypeFieldDescriptionprivate Stringstatic final HBaseClassTestRuleprivate static final byte[]private static final org.slf4j.Loggerprivate org.apache.hadoop.hbase.client.RegionLocatorprivate org.apache.hadoop.hbase.client.TableDescriptorprivate final HBaseTestingUtil -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafter()private voidDetermine if regions are balanced.voidbefore()static Collection<Object[]>data()private List<org.apache.hadoop.hbase.regionserver.HRegionServer>voidFor HBASE-71.private voidWait until all the regions are assigned.private voidWait on crash processing.
-
Field Details
-
CLASS_RULE
-
FAMILY_NAME
-
LOG
-
UTIL
-
regionLocator
-
tableDescriptor
-
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:
IOExceptionInterruptedException
-
waitOnCrashProcessing
Wait on crash processing. Balancer won't run if processing a crashed server.- Throws:
IOException
-
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
-