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
Modifier and TypeClassDescriptionstatic class
private static class
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.replication.regionserver.WALEntryStreamTestBase
WALEntryStreamTestBase.PathWatcher, WALEntryStreamTestBase.WALEntryStreamWithRetries
-
Field Summary
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
appendEntries
(org.apache.hadoop.hbase.wal.WALProvider.Writer writer, int numEntries) private void
appendEntriesToLogAndSync
(int count) private void
appendToLog
(String key) private org.apache.hadoop.hbase.replication.regionserver.MetricsReplicationGlobalSourceSource
private org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceWALReader
createReader
(boolean recovered, org.apache.hadoop.conf.Configuration conf) private org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceWALReader
createReaderWithBadReplicationFilter
(int numFailures, org.apache.hadoop.conf.Configuration conf) data()
private org.apache.hadoop.hbase.replication.WALEntryFilter
private org.apache.hadoop.hbase.replication.WALEntryFilter
getIntermittentFailingFilter
(int numFailuresInFilter) private PriorityBlockingQueue<org.apache.hadoop.fs.Path>
getQueue()
private String
getRow
(org.apache.hadoop.hbase.wal.WAL.Entry entry) private org.apache.hadoop.hbase.wal.WALEdit
getWALEdit
(String row) private org.apache.hadoop.hbase.replication.regionserver.ReplicationSource
mockReplicationSource
(boolean recovered, org.apache.hadoop.conf.Configuration conf) private org.apache.hadoop.hbase.wal.WAL.Entry
next
(org.apache.hadoop.hbase.replication.regionserver.WALEntryStream entryStream) void
setUp()
void
Tests basic reading of log appendsvoid
Tests that wals are closed cleanly and we read the trailer when we remove wal from WALEntryStream.void
void
Test removal of 0 length log from logQueue if the source is a recovered source and size of logQueue is only 1.void
void
Tests that we handle EOFException properly if the wal has moved to oldWALs directory.void
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 itvoid
Tests that if writes come in while we have a stream open, we shouldn't miss themvoid
Tests that if we stop before hitting the end of a stream, we can continue where we left off using the last positionvoid
void
void
void
void
void
This test is for HBASE-27778, whenWALEntryFilter.filter(org.apache.hadoop.hbase.wal.WAL.Entry)
throws exception for some entries inWALEntryBatch
,ReplicationSourceWALReader#totalBufferUsed
should be decreased becauseWALEntryBatch
is not put toReplicationSourceWALReader.entryBatchQueue
.void
void
void
Tests size of log queue is incremented and decremented properly.void
Methods 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:
IOException
InterruptedException
-
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#totalBufferUsed
should be decreased becauseWALEntryBatch
is not put toReplicationSourceWALReader.entryBatchQueue
.- Throws:
Exception
-