public class TestFSHLogProvider extends Object
Modifier and Type | Field and Description |
---|---|
static HBaseClassTestRule |
CLASS_RULE |
private static org.apache.hadoop.conf.Configuration |
conf |
org.junit.rules.TestName |
currentTest |
private static org.apache.hadoop.fs.FileSystem |
fs |
private static org.slf4j.Logger |
LOG |
private org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl |
mvcc |
private static HBaseTestingUtil |
TEST_UTIL |
Constructor and Description |
---|
TestFSHLogProvider() |
Modifier and Type | Method and Description |
---|---|
private 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,
NavigableMap<byte[],Integer> scopes) |
private void |
flushRegion(org.apache.hadoop.hbase.wal.WAL wal,
byte[] regionEncodedName,
Set<byte[]> flushedFamilyNames)
helper method to simulate region flush for a WAL.
|
private org.apache.hadoop.hbase.wal.WALKeyImpl |
getWalKey(byte[] info,
org.apache.hadoop.hbase.TableName tableName,
long timestamp,
NavigableMap<byte[],Integer> scopes)
used by TestDefaultWALProviderWithHLogKey
|
void |
setMembershipDedups()
Ensure that we can use Set.add to deduplicate WALs
|
void |
setUp() |
static void |
setUpBeforeClass() |
static void |
tearDownAfterClass() |
void |
testConcurrentWrites()
Write to a log file with three concurrent threads and verifying all data is written.
|
void |
testGetServerNameFromWALDirectoryName() |
void |
testLogCleaning() |
private void |
testLogCleaning(org.apache.hadoop.hbase.wal.WALFactory wals) |
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).
|
private void |
testWALArchiving(org.apache.hadoop.hbase.wal.WALFactory wals) |
private void |
waitNumRolledLogFiles(org.apache.hadoop.hbase.wal.WAL wal,
int expected) |
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static org.apache.hadoop.conf.Configuration conf
private static org.apache.hadoop.fs.FileSystem fs
private static final HBaseTestingUtil TEST_UTIL
private org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl mvcc
public final org.junit.rules.TestName currentTest
public TestFSHLogProvider()
public static void setUpBeforeClass() throws Exception
Exception
public static void tearDownAfterClass() throws Exception
Exception
public void testGetServerNameFromWALDirectoryName() throws IOException
IOException
private 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, NavigableMap<byte[],Integer> scopes) throws IOException
IOException
private org.apache.hadoop.hbase.wal.WALKeyImpl getWalKey(byte[] info, org.apache.hadoop.hbase.TableName tableName, long timestamp, NavigableMap<byte[],Integer> scopes)
private void flushRegion(org.apache.hadoop.hbase.wal.WAL wal, byte[] regionEncodedName, Set<byte[]> flushedFamilyNames)
private void waitNumRolledLogFiles(org.apache.hadoop.hbase.wal.WAL wal, int expected)
private void testLogCleaning(org.apache.hadoop.hbase.wal.WALFactory wals) throws IOException
IOException
public void testLogCleaning() throws Exception
Exception
private void testWALArchiving(org.apache.hadoop.hbase.wal.WALFactory wals) throws IOException
IOException
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.
IOException
public void testConcurrentWrites() throws Exception
Exception
public void setMembershipDedups() throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.