Class TestFSHLogProvider

java.lang.Object
org.apache.hadoop.hbase.wal.TestFSHLogProvider

@Tag("org.apache.hadoop.hbase.testclassification.RegionServerTests") @Tag("org.apache.hadoop.hbase.testclassification.MediumTests") public class TestFSHLogProvider extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static org.apache.hadoop.conf.Configuration
     
    private String
     
    private static org.apache.hadoop.fs.FileSystem
     
    private static final org.slf4j.Logger
     
    private org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl
     
    private static final HBaseTestingUtil
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    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
    Ensure that we can use Set.add to deduplicate WALs
    void
    setUp(org.junit.jupiter.api.TestInfo testInfo)
     
    static void
     
    static void
     
    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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • conf

      private static org.apache.hadoop.conf.Configuration conf
    • fs

      private static org.apache.hadoop.fs.FileSystem fs
    • TEST_UTIL

      private static final HBaseTestingUtil TEST_UTIL
    • mvcc

      private org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl mvcc
    • currentTestName

  • Constructor Details

  • Method Details

    • setUp

      @BeforeEach public void setUp(org.junit.jupiter.api.TestInfo testInfo) throws Exception
      Throws:
      Exception
    • setUpBeforeClass

      @BeforeAll public static void setUpBeforeClass() throws Exception
      Throws:
      Exception
    • tearDownAfterClass

      @AfterAll public static void tearDownAfterClass() throws Exception
      Throws:
      Exception
    • testGetServerNameFromWALDirectoryName

      Throws:
      IOException
    • addEdits

      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
      Throws:
      IOException
    • getWalKey

      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
    • 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

      private void waitNumRolledLogFiles(org.apache.hadoop.hbase.wal.WAL wal, int expected)
    • testLogCleaning

      private void testLogCleaning(org.apache.hadoop.hbase.wal.WALFactory wals) throws IOException
      Throws:
      IOException
    • testLogCleaning

      @Test public void testLogCleaning() throws Exception
      Throws:
      Exception
    • testWALArchiving

      private void testWALArchiving(org.apache.hadoop.hbase.wal.WALFactory wals) throws IOException
      Throws:
      IOException
    • testWALArchiving

      @Test public void testWALArchiving() throws IOException
      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
    • setMembershipDedups

      @Test public void setMembershipDedups() throws IOException
      Ensure that we can use Set.add to deduplicate WALs
      Throws:
      IOException