public abstract class AbstractTestFSWAL extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.hadoop.conf.Configuration |
CONF |
org.junit.rules.TestName |
currentTest |
protected static org.apache.hadoop.fs.Path |
DIR |
protected static org.apache.hadoop.fs.FileSystem |
FS |
protected static org.slf4j.Logger |
LOG |
protected static HBaseTestingUtility |
TEST_UTIL |
| Constructor and Description |
|---|
AbstractTestFSWAL() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addEdits(org.apache.hadoop.hbase.wal.WAL log,
org.apache.hadoop.hbase.client.RegionInfo hri,
org.apache.hadoop.hbase.client.TableDescriptor htd,
int times,
org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl mvcc,
NavigableMap<byte[],Integer> scopes) |
protected void |
flushRegion(org.apache.hadoop.hbase.wal.WAL wal,
byte[] regionEncodedName,
Set<byte[]> flushedFamilyNames)
helper method to simulate region flush for a WAL.
|
protected abstract org.apache.hadoop.hbase.regionserver.wal.AbstractFSWAL<?> |
newSlowWAL(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootDir,
String WALDir,
String archiveDir,
org.apache.hadoop.conf.Configuration conf,
List<org.apache.hadoop.hbase.regionserver.wal.WALActionsListener> listeners,
boolean failIfWALExists,
String prefix,
String suffix,
Runnable action) |
protected abstract org.apache.hadoop.hbase.regionserver.wal.AbstractFSWAL<?> |
newWAL(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootDir,
String WALDir,
String archiveDir,
org.apache.hadoop.conf.Configuration conf,
List<org.apache.hadoop.hbase.regionserver.wal.WALActionsListener> listeners,
boolean failIfWALExists,
String prefix,
String suffix) |
void |
setUp() |
static void |
setUpBeforeClass() |
static void |
tearDownAfterClass() |
void |
testFailedToCreateWALIfParentRenamed() |
void |
testFindMemStoresEligibleForFlush()
On rolling a wal after reaching the threshold,
WAL.rollWriter() returns the list of
regions which should be flushed in order to archive the oldest wal file. |
void |
testFlushSequenceIdIsGreaterThanAllEditsInHFile()
Test flush for sure has a sequence id that is beyond the last edit appended.
|
void |
testSyncNoAppend() |
void |
testUnflushedSeqIdTrackingWithAsyncWal() |
void |
testWALComparator()
tests the log comparator.
|
void |
testWALCoprocessorLoaded()
A loaded WAL coprocessor won't break existing WAL test cases.
|
void |
testWriteEntryCanBeNull() |
protected static final org.slf4j.Logger LOG
protected static org.apache.hadoop.conf.Configuration CONF
protected static org.apache.hadoop.fs.FileSystem FS
protected static org.apache.hadoop.fs.Path DIR
protected static final HBaseTestingUtility TEST_UTIL
public final org.junit.rules.TestName currentTest
public AbstractTestFSWAL()
public static void setUpBeforeClass() throws Exception
Exceptionpublic static void tearDownAfterClass() throws Exception
Exceptionprotected abstract org.apache.hadoop.hbase.regionserver.wal.AbstractFSWAL<?> newWAL(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, String WALDir, String archiveDir, org.apache.hadoop.conf.Configuration conf, List<org.apache.hadoop.hbase.regionserver.wal.WALActionsListener> listeners, boolean failIfWALExists, String prefix, String suffix) throws IOException
IOExceptionprotected abstract org.apache.hadoop.hbase.regionserver.wal.AbstractFSWAL<?> newSlowWAL(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, String WALDir, String archiveDir, org.apache.hadoop.conf.Configuration conf, List<org.apache.hadoop.hbase.regionserver.wal.WALActionsListener> listeners, boolean failIfWALExists, String prefix, String suffix, Runnable action) throws IOException
IOExceptionpublic void testWALCoprocessorLoaded() throws Exception
Exceptionprotected void addEdits(org.apache.hadoop.hbase.wal.WAL log, org.apache.hadoop.hbase.client.RegionInfo hri, org.apache.hadoop.hbase.client.TableDescriptor htd, int times, org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl mvcc, NavigableMap<byte[],Integer> scopes) throws IOException
IOExceptionprotected void flushRegion(org.apache.hadoop.hbase.wal.WAL wal, byte[] regionEncodedName, Set<byte[]> flushedFamilyNames)
wal - regionEncodedName - public void testWALComparator() throws Exception
Exceptionpublic void testFindMemStoresEligibleForFlush() throws Exception
WAL.rollWriter() returns the list of
regions which should be flushed in order to archive the oldest wal file.
This method tests this behavior by inserting edits and rolling the wal enough times to reach the max number of logs threshold. It checks whether we get the "right regions" for flush on rolling the wal.
Exceptionpublic void testFailedToCreateWALIfParentRenamed() throws IOException, org.apache.hadoop.hbase.util.CommonFSUtils.StreamLacksCapabilityException
IOExceptionorg.apache.hadoop.hbase.util.CommonFSUtils.StreamLacksCapabilityExceptionpublic void testFlushSequenceIdIsGreaterThanAllEditsInHFile() throws IOException
IOExceptionpublic void testSyncNoAppend() throws IOException
IOExceptionpublic void testWriteEntryCanBeNull() throws IOException
IOExceptionpublic void testUnflushedSeqIdTrackingWithAsyncWal() throws IOException, InterruptedException
IOExceptionInterruptedExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.