Class TestRegionNormalizerWorker
java.lang.Object
org.apache.hadoop.hbase.master.normalizer.TestRegionNormalizerWorker
A test over
RegionNormalizerWorker. Being a background thread, the only points of
interaction we have to this class are its input source (RegionNormalizerWorkQueue and its
callbacks invoked against RegionNormalizer and MasterServices. The work queue is
simple enough to use directly; for MasterServices, use a mock because, as of now, the
worker only invokes 4 methods.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleprivate org.apache.hadoop.hbase.master.MasterServicesorg.mockito.junit.MockitoRuleprivate org.apache.hadoop.hbase.master.normalizer.RegionNormalizerWorkQueue<org.apache.hadoop.hbase.TableName>private org.apache.hadoop.hbase.master.normalizer.RegionNormalizerprivate HBaseCommonTestingUtilityorg.junit.rules.TestNameprivate ExecutorServiceprivate final AtomicReference<Throwable> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafter()private <T> voidassertThatEventually(String reason, Supplier<? extends T> actualSupplier, org.hamcrest.Matcher<? super T> matcher) Repeatedly evaluatesmatcheragainst the result of callingactualSupplieruntil the matcher succeeds or the timeout period of 30 seconds is exhausted.voidbefore()voidvoidvoidAssert that a rate limit is honored, at least in a rough way.void
-
Field Details
-
CLASS_RULE
-
testName
-
tableName
-
mockitoRule
-
masterServices
@Mock(answer=RETURNS_DEEP_STUBS) private org.apache.hadoop.hbase.master.MasterServices masterServices -
regionNormalizer
-
testingUtility
-
queue
private org.apache.hadoop.hbase.master.normalizer.RegionNormalizerWorkQueue<org.apache.hadoop.hbase.TableName> queue -
workerPool
-
workerThreadThrowable
-
-
Constructor Details
-
TestRegionNormalizerWorker
public TestRegionNormalizerWorker()
-
-
Method Details
-
before
- Throws:
Exception
-
after
- Throws:
Exception
-
testMergeCounter
- Throws:
Exception
-
testSplitCounter
- Throws:
Exception
-
testRateLimit
Assert that a rate limit is honored, at least in a rough way. Maintainers should manually inspect the log messages emitted by the worker thread to confirm that expected behavior.- Throws:
Exception
-
testPlansSizeLimit
- Throws:
Exception
-
assertThatEventually
private <T> void assertThatEventually(String reason, Supplier<? extends T> actualSupplier, org.hamcrest.Matcher<? super T> matcher) throws Exception Repeatedly evaluatesmatcheragainst the result of callingactualSupplieruntil the matcher succeeds or the timeout period of 30 seconds is exhausted.- Throws:
Exception
-