public abstract class TestBasicWALEntryStream extends WALEntryStreamTestBase
Modifier and Type | Class and Description |
---|---|
static class |
TestBasicWALEntryStream.FailingWALEntryFilter |
private static class |
TestBasicWALEntryStream.PartialWALEntryFailingWALEntryFilter |
WALEntryStreamTestBase.PathWatcher, WALEntryStreamTestBase.WALEntryStreamWithRetries
Modifier and Type | Field and Description |
---|---|
boolean |
isCompressionEnabled |
cluster, CONF, fakeWalGroupId, family, fs, info, log, logQueue, mvcc, pathWatcher, qualifier, scopes, tableName, TEST_TIMEOUT_MS, TEST_UTIL, tn
Constructor and Description |
---|
TestBasicWALEntryStream() |
Modifier and Type | Method and Description |
---|---|
private 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 |
createMockGlobalMetrics() |
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) |
static Iterable<Object[]> |
data() |
private org.apache.hadoop.hbase.replication.WALEntryFilter |
getDummyFilter() |
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 |
testAppendsWithRolls()
Tests basic reading of log appends
|
void |
testCleanClosedWALs()
Tests that wals are closed cleanly and we read the trailer when we remove wal from
WALEntryStream.
|
void |
testEmptyStream() |
void |
testEOFExceptionForRecoveredQueue()
Test removal of 0 length log from logQueue if the source is a recovered source and size of
logQueue is only 1.
|
void |
testEOFExceptionForRecoveredQueueWithMultipleLogs() |
void |
testEOFExceptionInOldWALsDirectory()
Tests that we handle EOFException properly if the wal has moved to oldWALs directory.
|
void |
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
|
void |
testNewEntriesWhileStreaming()
Tests that if writes come in while we have a stream open, we shouldn't miss them
|
void |
testPosition()
Tests that if we stop before hitting the end of a stream, we can continue where we left off
using the last position
|
void |
testReadBeyondCommittedLength() |
void |
testReplicationSourceWALReader() |
void |
testReplicationSourceWALReaderDisabled() |
void |
testReplicationSourceWALReaderRecovered() |
void |
testReplicationSourceWALReaderWithFailingFilter() |
void |
testReplicationSourceWALReaderWithPartialWALEntryFailingFilter()
This test is for HBASE-27778, when
WALEntryFilter.filter(org.apache.hadoop.hbase.wal.WAL.Entry) throws exception for some
entries in WALEntryBatch ,ReplicationSourceWALReader#totalBufferUsed should be
decreased because WALEntryBatch is not put to
ReplicationSourceWALReader.entryBatchQueue . |
void |
testReplicationSourceWALReaderWrongPosition() |
void |
testResumeStreamingFromPosition() |
void |
testSizeOfLogQueue()
Tests size of log queue is incremented and decremented properly.
|
void |
testWALKeySerialization() |
appendToLog, appendToLogAndSync, appendToLogAndSync, getWALEdits, initWAL, startCluster, tearDown, tearDownAfterClass
public boolean isCompressionEnabled
public TestBasicWALEntryStream()
private org.apache.hadoop.hbase.wal.WAL.Entry next(org.apache.hadoop.hbase.replication.regionserver.WALEntryStream entryStream)
public void testAppendsWithRolls() throws Exception
Exception
public void testLogRollWhileStreaming() throws Exception
Exception
public void testNewEntriesWhileStreaming() throws Exception
Exception
public void testResumeStreamingFromPosition() throws Exception
Exception
public void testPosition() throws Exception
Exception
public void testEmptyStream() throws Exception
Exception
public void testWALKeySerialization() throws Exception
Exception
private org.apache.hadoop.hbase.replication.regionserver.ReplicationSource mockReplicationSource(boolean recovered, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
private org.apache.hadoop.hbase.replication.regionserver.MetricsReplicationGlobalSourceSource createMockGlobalMetrics()
private org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceWALReader createReader(boolean recovered, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
private org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceWALReader createReaderWithBadReplicationFilter(int numFailures, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
public void testReplicationSourceWALReader() throws Exception
Exception
public void testReplicationSourceWALReaderWithFailingFilter() throws Exception
Exception
public void testReplicationSourceWALReaderRecovered() throws Exception
Exception
public void testReplicationSourceWALReaderWrongPosition() throws Exception
Exception
public void testReplicationSourceWALReaderDisabled() throws IOException, InterruptedException, ExecutionException
private void appendToLog(String key) throws IOException
IOException
private void appendEntriesToLogAndSync(int count) throws IOException
IOException
private org.apache.hadoop.hbase.wal.WALEdit getWALEdit(String row)
private org.apache.hadoop.hbase.replication.WALEntryFilter getDummyFilter()
private org.apache.hadoop.hbase.replication.WALEntryFilter getIntermittentFailingFilter(int numFailuresInFilter)
public void testReadBeyondCommittedLength() throws IOException, InterruptedException
IOException
InterruptedException
public void testEOFExceptionForRecoveredQueue() throws Exception
Exception
public void testEOFExceptionForRecoveredQueueWithMultipleLogs() throws Exception
Exception
private PriorityBlockingQueue<org.apache.hadoop.fs.Path> getQueue()
private void appendEntries(org.apache.hadoop.hbase.wal.WALProvider.Writer writer, int numEntries) throws IOException
IOException
public void testSizeOfLogQueue() throws Exception
Exception
public void testCleanClosedWALs() throws Exception
Exception
public void testEOFExceptionInOldWALsDirectory() throws Exception
Exception
public void testReplicationSourceWALReaderWithPartialWALEntryFailingFilter() throws Exception
WALEntryFilter.filter(org.apache.hadoop.hbase.wal.WAL.Entry)
throws exception for some
entries in WALEntryBatch
,ReplicationSourceWALReader#totalBufferUsed
should be
decreased because WALEntryBatch
is not put to
ReplicationSourceWALReader.entryBatchQueue
.Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.