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 HBaseTestingUtility |
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) |
protected void |
flushRegion(org.apache.hadoop.hbase.wal.WAL wal,
byte[] regionEncodedName,
Set<byte[]> flushedFamilyNames)
helper method to simulate region flush for a WAL.
|
(package private) static String |
getName() |
(package 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 n
|
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() |
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).
|
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 HBaseTestingUtility 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
org.apache.hadoop.hbase.wal.WALKeyImpl getWalKey(byte[] info, org.apache.hadoop.hbase.TableName tableName, long timestamp, NavigableMap<byte[],Integer> scopes)
protected void flushRegion(org.apache.hadoop.hbase.wal.WAL wal, byte[] regionEncodedName, Set<byte[]> flushedFamilyNames)
public void testLogCleaning() throws Exception
Exception
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.
n
IOException
public void testConcurrentWrites() throws Exception
Exception
public void setMembershipDedups() throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.