Class TestBasicWALEntryStream
java.lang.Object
org.apache.hadoop.hbase.replication.regionserver.WALEntryStreamTestBase
org.apache.hadoop.hbase.replication.regionserver.TestBasicWALEntryStream
- Direct Known Subclasses:
TestBasicWALEntryStreamAsyncFSWAL,TestBasicWALEntryStreamFSHLog
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static classNested classes/interfaces inherited from class org.apache.hadoop.hbase.replication.regionserver.WALEntryStreamTestBase
WALEntryStreamTestBase.PathWatcher, WALEntryStreamTestBase.WALEntryStreamWithRetries -
Field Summary
FieldsFields inherited from class org.apache.hadoop.hbase.replication.regionserver.WALEntryStreamTestBase
cluster, CONF, fakeWalGroupId, family, fs, info, log, logQueue, mvcc, pathWatcher, qualifier, scopes, tableName, TEST_TIMEOUT_MS, TEST_UTIL, tn -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidappendEntries(org.apache.hadoop.hbase.wal.WALProvider.Writer writer, int numEntries) private voidappendEntriesToLogAndSync(int count) private voidappendToLog(String key) private org.apache.hadoop.hbase.replication.regionserver.MetricsReplicationGlobalSourceSourceprivate org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceWALReadercreateReader(boolean recovered, org.apache.hadoop.conf.Configuration conf) private org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceWALReadercreateReaderWithBadReplicationFilter(int numFailures, org.apache.hadoop.conf.Configuration conf) data()private org.apache.hadoop.hbase.replication.WALEntryFilterprivate org.apache.hadoop.hbase.replication.WALEntryFiltergetIntermittentFailingFilter(int numFailuresInFilter) private PriorityBlockingQueue<org.apache.hadoop.fs.Path>getQueue()private StringgetRow(org.apache.hadoop.hbase.wal.WAL.Entry entry) private org.apache.hadoop.hbase.wal.WALEditgetWALEdit(String row) private org.apache.hadoop.hbase.replication.regionserver.ReplicationSourcemockReplicationSource(boolean recovered, org.apache.hadoop.conf.Configuration conf) private org.apache.hadoop.hbase.wal.WAL.Entrynext(org.apache.hadoop.hbase.replication.regionserver.WALEntryStream entryStream) voidsetUp()voidTests basic reading of log appendsvoidTests that wals are closed cleanly and we read the trailer when we remove wal from WALEntryStream.voidvoidTest removal of 0 length log from logQueue if the source is a recovered source and size of logQueue is only 1.voidvoidTests that we handle EOFException properly if the wal has moved to oldWALs directory.voidTests that if after a stream is opened, more entries come in and then the log is rolled, we don't mistakenly dequeue the current log thinking we're done with itvoidTests that if writes come in while we have a stream open, we shouldn't miss themvoidTests that if we stop before hitting the end of a stream, we can continue where we left off using the last positionvoidvoidvoidvoidvoidvoidThis test is for HBASE-27778, whenWALEntryFilter.filter(org.apache.hadoop.hbase.wal.WAL.Entry)throws exception for some entries inWALEntryBatch,ReplicationSourceWALReader#totalBufferUsedshould be decreased becauseWALEntryBatchis not put toReplicationSourceWALReader.entryBatchQueue.voidvoidvoidTests size of log queue is incremented and decremented properly.voidMethods inherited from class org.apache.hadoop.hbase.replication.regionserver.WALEntryStreamTestBase
appendToLog, appendToLogAndSync, appendToLogAndSync, getWALEdits, initWAL, startCluster, tearDown, tearDownAfterClass
-
Field Details
-
isCompressionEnabled
-
-
Constructor Details
-
TestBasicWALEntryStream
public TestBasicWALEntryStream()
-
-
Method Details
-
data
-
setUp
- Throws:
Exception
-
next
private org.apache.hadoop.hbase.wal.WAL.Entry next(org.apache.hadoop.hbase.replication.regionserver.WALEntryStream entryStream) -
testAppendsWithRolls
Tests basic reading of log appends- Throws:
Exception
-
testLogRollWhileStreaming
Tests that if after a stream is opened, more entries come in and then the log is rolled, we don't mistakenly dequeue the current log thinking we're done with it- Throws:
Exception
-
testNewEntriesWhileStreaming
Tests that if writes come in while we have a stream open, we shouldn't miss them- Throws:
Exception
-
testResumeStreamingFromPosition
- Throws:
Exception
-
testPosition
Tests that if we stop before hitting the end of a stream, we can continue where we left off using the last position- Throws:
Exception
-
testEmptyStream
- Throws:
Exception
-
testWALKeySerialization
- Throws:
Exception
-
mockReplicationSource
private org.apache.hadoop.hbase.replication.regionserver.ReplicationSource mockReplicationSource(boolean recovered, org.apache.hadoop.conf.Configuration conf) throws IOException - Throws:
IOException
-
createMockGlobalMetrics
private org.apache.hadoop.hbase.replication.regionserver.MetricsReplicationGlobalSourceSource createMockGlobalMetrics() -
createReader
private org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceWALReader createReader(boolean recovered, org.apache.hadoop.conf.Configuration conf) throws IOException - Throws:
IOException
-
createReaderWithBadReplicationFilter
private org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceWALReader createReaderWithBadReplicationFilter(int numFailures, org.apache.hadoop.conf.Configuration conf) throws IOException - Throws:
IOException
-
testReplicationSourceWALReader
- Throws:
Exception
-
testReplicationSourceWALReaderWithFailingFilter
- Throws:
Exception
-
testReplicationSourceWALReaderRecovered
- Throws:
Exception
-
testReplicationSourceWALReaderWrongPosition
- Throws:
Exception
-
testReplicationSourceWALReaderDisabled
public void testReplicationSourceWALReaderDisabled() throws IOException, InterruptedException, ExecutionException -
getRow
-
appendToLog
- Throws:
IOException
-
appendEntriesToLogAndSync
- Throws:
IOException
-
getWALEdit
-
getDummyFilter
-
getIntermittentFailingFilter
private org.apache.hadoop.hbase.replication.WALEntryFilter getIntermittentFailingFilter(int numFailuresInFilter) -
testReadBeyondCommittedLength
- Throws:
IOExceptionInterruptedException
-
testEOFExceptionForRecoveredQueue
Test removal of 0 length log from logQueue if the source is a recovered source and size of logQueue is only 1.- Throws:
Exception
-
testEOFExceptionForRecoveredQueueWithMultipleLogs
- Throws:
Exception
-
getQueue
-
appendEntries
private void appendEntries(org.apache.hadoop.hbase.wal.WALProvider.Writer writer, int numEntries) throws IOException - Throws:
IOException
-
testSizeOfLogQueue
Tests size of log queue is incremented and decremented properly.- Throws:
Exception
-
testCleanClosedWALs
Tests that wals are closed cleanly and we read the trailer when we remove wal from WALEntryStream.- Throws:
Exception
-
testEOFExceptionInOldWALsDirectory
Tests that we handle EOFException properly if the wal has moved to oldWALs directory.- Throws:
Exception
-
testReplicationSourceWALReaderWithPartialWALEntryFailingFilter
This test is for HBASE-27778, whenWALEntryFilter.filter(org.apache.hadoop.hbase.wal.WAL.Entry)throws exception for some entries inWALEntryBatch,ReplicationSourceWALReader#totalBufferUsedshould be decreased becauseWALEntryBatchis not put toReplicationSourceWALReader.entryBatchQueue.- Throws:
Exception
-