public class TestDefaultWALProvider extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static Configuration |
conf |
TestName |
currentTest |
protected static FileSystem |
fs |
protected static Log |
LOG |
protected static HBaseTestingUtility |
TEST_UTIL |
| Constructor and Description |
|---|
TestDefaultWALProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addEdits(WAL log,
HRegionInfo hri,
HTableDescriptor htd,
int times,
AtomicLong sequenceId) |
protected void |
flushRegion(WAL wal,
byte[] regionEncodedName,
Set<byte[]> flushedFamilyNames)
helper method to simulate region flush for a WAL.
|
void |
setMembershipDedups()
Ensure that we can use Set.add to deduplicate WALs
|
void |
setUp() |
static void |
setUpBeforeClass() |
void |
tearDown() |
static void |
tearDownAfterClass() |
void |
testConcurrentWrites()
Write to a log file with three concurrent threads and verifying all data is written.
|
void |
testGetServerNameFromWALDirectoryName() |
void |
testLogCleaning() |
void |
testWALArchiving()
Tests wal archiving by adding data, doing flushing/rolling and checking we archive old logs
and also don't archive "live logs" (that is, a log with un-flushed entries).
|
protected static final Log LOG
protected static Configuration conf
protected static FileSystem fs
protected static final HBaseTestingUtility TEST_UTIL
public final TestName currentTest
public void testGetServerNameFromWALDirectoryName()
throws IOException
IOExceptionprotected void addEdits(WAL log, HRegionInfo hri, HTableDescriptor htd, int times, AtomicLong sequenceId) throws IOException
IOExceptionprotected void flushRegion(WAL wal, byte[] regionEncodedName, Set<byte[]> flushedFamilyNames)
wal - regionEncodedName - public void testWALArchiving()
throws IOException
This is what it does: It creates two regions, and does a series of inserts along with log rolling. Whenever a WAL is rolled, HLogBase checks previous wals for archiving. A wal is eligible for archiving if for all the regions which have entries in that wal file, have flushed - past their maximum sequence id in that wal file.
IOExceptionpublic void testConcurrentWrites()
throws Exception
Exceptionpublic void setMembershipDedups()
throws IOException
IOException