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
Exception
public static void tearDownAfterClass() throws Exception
Exception
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) throws IOException
IOException
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) throws IOException
IOException
public void testWALCoprocessorLoaded() throws Exception
Exception
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) throws IOException
IOException
protected void flushRegion(org.apache.hadoop.hbase.wal.WAL wal, byte[] regionEncodedName, Set<byte[]> flushedFamilyNames)
wal
- regionEncodedName
- public void testWALComparator() throws Exception
Exception
public 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.
Exception
public void testFailedToCreateWALIfParentRenamed() throws IOException, org.apache.hadoop.hbase.util.CommonFSUtils.StreamLacksCapabilityException
IOException
org.apache.hadoop.hbase.util.CommonFSUtils.StreamLacksCapabilityException
public void testFlushSequenceIdIsGreaterThanAllEditsInHFile() throws IOException
IOException
public void testSyncNoAppend() throws IOException
IOException
public void testWriteEntryCanBeNull() throws IOException
IOException
public void testUnflushedSeqIdTrackingWithAsyncWal() throws IOException, InterruptedException
IOException
InterruptedException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.