Package org.apache.hadoop.hbase.wal
Class TestFSHLogProvider
java.lang.Object
org.apache.hadoop.hbase.wal.TestFSHLogProvider
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static org.apache.hadoop.conf.Configuration
final org.junit.rules.TestName
private static org.apache.hadoop.fs.FileSystem
private static final org.slf4j.Logger
private org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl
private static final HBaseTestingUtility
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate 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 TestDefaultWALProviderWithHLogKeyvoid
Ensure that we can use Set.add to deduplicate WALsvoid
setUp()
static void
static void
void
Write to a log file with three concurrent threads and verifying all data is written.void
void
private void
testLogCleaning
(org.apache.hadoop.hbase.wal.WALFactory wals) void
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)
-
Field Details
-
CLASS_RULE
-
LOG
-
conf
-
fs
-
TEST_UTIL
-
mvcc
-
currentTest
-
-
Constructor Details
-
TestFSHLogProvider
public TestFSHLogProvider()
-
-
Method Details
-
setUp
- Throws:
Exception
-
setUpBeforeClass
- Throws:
Exception
-
tearDownAfterClass
- Throws:
Exception
-
testGetServerNameFromWALDirectoryName
- Throws:
IOException
-
flushRegion
private void flushRegion(org.apache.hadoop.hbase.wal.WAL wal, byte[] regionEncodedName, Set<byte[]> flushedFamilyNames) helper method to simulate region flush for a WAL. -
waitNumRolledLogFiles
-
testLogCleaning
- Throws:
IOException
-
testLogCleaning
- Throws:
Exception
-
testWALArchiving
- Throws:
IOException
-
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).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.
- Throws:
IOException
-
testConcurrentWrites
Write to a log file with three concurrent threads and verifying all data is written.- Throws:
Exception
-
setMembershipDedups
Ensure that we can use Set.add to deduplicate WALs- Throws:
IOException
-