Package org.apache.hadoop.hbase
Class TestRegionRebalancing
java.lang.Object
org.apache.hadoop.hbase.TestRegionRebalancing
@Tag("org.apache.hadoop.hbase.testclassification.FlakeyTests") @Tag("org.apache.hadoop.hbase.testclassification.LargeTests")
public class TestRegionRebalancing
extends Object
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 Stringprivate 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()private List<org.apache.hadoop.hbase.regionserver.HRegionServer>static Stream<org.junit.jupiter.params.provider.Arguments>voidFor HBASE-71.private voidWait until all the regions are assigned.private voidWait on crash processing.
-
Field Details
-
FAMILY_NAME
-
LOG
-
UTIL
-
regionLocator
-
tableDescriptor
-
balancerName
-
-
Constructor Details
-
TestRegionRebalancing
-
-
Method Details
-
parameters
-
after
- Throws:
Exception
-
before
- Throws:
Exception
-
testRebalanceOnRegionServerNumberChange
@TestTemplate public void testRebalanceOnRegionServerNumberChange() throws IOException, InterruptedExceptionFor 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
-