public abstract class AbstractTestFSWAL extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AbstractTestFSWAL.FlushSpecificStoresPolicy |
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 |
private static Set<byte[]> |
STORES_TO_FLUSH |
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,
String cf) |
private org.apache.hadoop.hbase.regionserver.HRegion |
createHoldingHRegion(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.client.TableDescriptor htd,
org.apache.hadoop.hbase.wal.WAL wal) |
private org.apache.hadoop.hbase.regionserver.wal.AbstractFSWAL<?> |
createHoldingWAL(String testName,
AtomicBoolean startHoldingForAppend,
CountDownLatch holdAppend) |
private void |
doPutWithAsyncWAL(ExecutorService exec,
org.apache.hadoop.hbase.regionserver.HRegion region,
org.apache.hadoop.hbase.client.Put put,
Runnable flushOrCloseRegion,
AtomicBoolean startHoldingForAppend,
CountDownLatch flushOrCloseFinished,
CountDownLatch holdAppend) |
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 |
testMaxFlushedSequenceIdGoBackwards() |
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
private static final Set<byte[]> STORES_TO_FLUSH
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, String cf) throws IOException
IOException
protected void flushRegion(org.apache.hadoop.hbase.wal.WAL wal, byte[] regionEncodedName, Set<byte[]> flushedFamilyNames)
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 and stores" for flush on rolling the wal. n
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
private org.apache.hadoop.hbase.regionserver.wal.AbstractFSWAL<?> createHoldingWAL(String testName, AtomicBoolean startHoldingForAppend, CountDownLatch holdAppend) throws IOException
IOException
private org.apache.hadoop.hbase.regionserver.HRegion createHoldingHRegion(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.TableDescriptor htd, org.apache.hadoop.hbase.wal.WAL wal) throws IOException
IOException
private void doPutWithAsyncWAL(ExecutorService exec, org.apache.hadoop.hbase.regionserver.HRegion region, org.apache.hadoop.hbase.client.Put put, Runnable flushOrCloseRegion, AtomicBoolean startHoldingForAppend, CountDownLatch flushOrCloseFinished, CountDownLatch holdAppend) throws InterruptedException, IOException
InterruptedException
IOException
public void testUnflushedSeqIdTrackingWithAsyncWal() throws IOException, InterruptedException
IOException
InterruptedException
public void testMaxFlushedSequenceIdGoBackwards() throws IOException, InterruptedException
IOException
InterruptedException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.