Class TestBucketWriterThread
java.lang.Object
org.apache.hadoop.hbase.io.hfile.bucket.TestBucketWriterThread
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classA BucketCache that does not start its writer threads. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.io.hfile.bucket.BucketCachestatic final HBaseClassTestRuleprivate org.apache.hadoop.hbase.io.hfile.Cacheableprivate org.apache.hadoop.hbase.io.hfile.BlockCacheKeyprivate BlockingQueue<org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.RAMQueueEntry>private org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.WriterThread -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voiddoDrainOfOneEntry(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache bc, org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.WriterThread wt, BlockingQueue<org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.RAMQueueEntry> q) voidsetUp()Set up variables and get BucketCache and WriterThread into state where tests can manually control the running of WriterThread and BucketCache is empty.voidtearDown()voidDo Cache full exceptionvoidtestIOE()Do IOE.voidTest non-error case just works.voidPass through a too big entry and ensure it is cleared from queues and ramCache.
-
Field Details
-
CLASS_RULE
-
bc
-
wt
-
q
-
plainCacheable
-
plainKey
-
-
Constructor Details
-
TestBucketWriterThread
public TestBucketWriterThread()
-
-
Method Details
-
setUp
Set up variables and get BucketCache and WriterThread into state where tests can manually control the running of WriterThread and BucketCache is empty.- Throws:
Exception
-
tearDown
- Throws:
Exception
-
testNonErrorCase
Test non-error case just works.- Throws:
IOExceptionInterruptedException
-
testTooBigEntry
Pass through a too big entry and ensure it is cleared from queues and ramCache. Manually run the WriterThread.- Throws:
InterruptedException
-
testIOE
Do IOE. Take the RAMQueueEntry that was on the queue, doctor it to throw exception, then put it back and process it.- Throws:
IOExceptionInterruptedException
-
testCacheFullException
Do Cache full exception- Throws:
IOExceptionInterruptedException
-
doDrainOfOneEntry
private static void doDrainOfOneEntry(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache bc, org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.WriterThread wt, BlockingQueue<org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.RAMQueueEntry> q) throws InterruptedException - Throws:
InterruptedException
-