public class TestFSHLog
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static Configuration |
conf |
TestName |
currentTest |
protected static Path |
dir |
protected static FileSystem |
fs |
protected static Log |
LOG |
protected static Path |
rootDir |
protected static HBaseTestingUtility |
TEST_UTIL |
protected static Path |
walRootDir |
| Constructor and Description |
|---|
TestFSHLog() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addEdits(WAL log,
HRegionInfo hri,
HTableDescriptor htd,
int times,
java.util.concurrent.atomic.AtomicLong sequenceId) |
protected void |
flushRegion(WAL wal,
byte[] regionEncodedName,
java.util.Set<byte[]> flushedFamilyNames)
helper method to simulate region flush for a WAL.
|
void |
setUp() |
static void |
setUpBeforeClass() |
void |
tearDown() |
static void |
tearDownAfterClass() |
void |
testAllRegionsFlushed()
Simulates WAL append ops for a region and tests
FSHLog#areAllRegionsFlushed(Map, Map, Map) API. |
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 |
testSyncRunnerIndexOverflow() |
void |
testUnflushedSeqIdTracking()
Test case for https://issues.apache.org/jira/browse/HBASE-16721
|
void |
testWALComparator()
tests the log comparator.
|
void |
testWALCoprocessorLoaded()
A loaded WAL coprocessor won't break existing WAL test cases.
|
protected static final Log LOG
protected static Configuration conf
protected static FileSystem fs
protected static Path dir
protected static Path rootDir
protected static Path walRootDir
protected static final HBaseTestingUtility TEST_UTIL
public final TestName currentTest
public void setUp()
throws java.lang.Exception
java.lang.Exceptionpublic void tearDown()
throws java.lang.Exception
java.lang.Exceptionpublic static void setUpBeforeClass()
throws java.lang.Exception
java.lang.Exceptionpublic static void tearDownAfterClass()
throws java.lang.Exception
java.lang.Exceptionpublic void testWALCoprocessorLoaded()
throws java.lang.Exception
java.lang.Exceptionprotected void addEdits(WAL log,
HRegionInfo hri,
HTableDescriptor htd,
int times,
java.util.concurrent.atomic.AtomicLong sequenceId)
throws java.io.IOException
java.io.IOExceptionprotected void flushRegion(WAL wal,
byte[] regionEncodedName,
java.util.Set<byte[]> flushedFamilyNames)
wal - regionEncodedName - public void testWALComparator()
throws java.lang.Exception
java.lang.Exceptionpublic void testFindMemStoresEligibleForFlush()
throws java.lang.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.
java.lang.Exceptionpublic void testAllRegionsFlushed()
FSHLog#areAllRegionsFlushed(Map, Map, Map) API.
It compares the region sequenceIds with oldestFlushing and oldestUnFlushed entries.
If a region's entries are larger than min of (oldestFlushing, oldestUnFlushed), then the
region should be flushed before archiving this WAL.public void testFailedToCreateWALIfParentRenamed()
throws java.io.IOException
java.io.IOExceptionpublic void testFlushSequenceIdIsGreaterThanAllEditsInHFile()
throws java.io.IOException
java.io.IOExceptionpublic void testSyncRunnerIndexOverflow()
throws java.io.IOException,
java.lang.NoSuchFieldException,
java.lang.SecurityException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
java.io.IOExceptionjava.lang.NoSuchFieldExceptionjava.lang.SecurityExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionpublic void testUnflushedSeqIdTracking()
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOExceptionjava.lang.InterruptedException