Class TestMetaRegionReplicaReplication

java.lang.Object
org.apache.hadoop.hbase.replication.regionserver.TestMetaRegionReplicaReplication

@Tag("org.apache.hadoop.hbase.testclassification.ReplicationTests") @Tag("org.apache.hadoop.hbase.testclassification.LargeTests") public class TestMetaRegionReplicaReplication extends Object
Tests region replication for hbase:meta by setting up region replicas and verifying async wal replication replays the edits to the secondary region in various scenarios.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • before

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

      @AfterEach public void after() throws Exception
      Throws:
      Exception
    • testHBaseMetaReplicates

      @Test public void testHBaseMetaReplicates() throws Exception
      Test meta region replica replication. Create some tables and see if replicas pick up the additions.
      Throws:
      Exception
    • testCatalogReplicaReplicationWithFlushAndCompaction

      Throws:
      Exception
    • testCatalogReplicaReplicationWithReplicaMoved

      Throws:
      Exception
    • verifyReplication

      protected void verifyReplication(org.apache.hadoop.hbase.TableName tableName, int regionReplication, int startRow, int endRow, byte[] family) throws Exception
      Throws:
      Exception
    • verifyReplication

      private void verifyReplication(org.apache.hadoop.hbase.TableName tableName, int regionReplication, int startRow, int endRow, byte[] family, boolean present) throws Exception
      Throws:
      Exception
    • getMetaCells

      private List<org.apache.hadoop.hbase.client.Result> getMetaCells(org.apache.hadoop.hbase.TableName tableName) throws IOException
      Scan hbase:meta for tableName content.
      Throws:
      IOException
    • getAllRegions

      private org.apache.hadoop.hbase.regionserver.Region[] getAllRegions(org.apache.hadoop.hbase.TableName tableName, int replication)
      Returns All Regions for tableName including Replicas.
    • verifyDeletedReplication

      private void verifyDeletedReplication(org.apache.hadoop.hbase.TableName tableName, int regionReplication, org.apache.hadoop.hbase.TableName deletedTableName)
      Verify when a Table is deleted from primary, then there are no references in replicas (because they get the delete of the table rows too).
    • doesNotContain

      private boolean doesNotContain(List<org.apache.hadoop.hbase.Cell> cells, org.apache.hadoop.hbase.TableName tableName)
      Cells are from hbase:meta replica so will start w/ 'tableName,'; i.e. the tablename followed by HConstants.DELIMITER. Make sure the deleted table is no longer present in passed cells.
    • verifyReplication

      private void verifyReplication(org.apache.hadoop.hbase.TableName tableName, int regionReplication, List<org.apache.hadoop.hbase.client.Result> contains)
      Verify Replicas have results (exactly).
    • contains

      static boolean contains(List<org.apache.hadoop.hbase.client.Result> contains, List<org.apache.hadoop.hbase.Cell> cells) throws IOException
      Presumes sorted Cells. Verify that cells has contains at least.
      Throws:
      IOException
    • doNGets

      private void doNGets(org.apache.hadoop.hbase.client.Table table, byte[][] keys) throws Exception
      Throws:
      Exception
    • primaryIncreaseReplicaNoChange

      private void primaryIncreaseReplicaNoChange(long[] before, long[] after)
    • primaryIncreaseReplicaIncrease

      private void primaryIncreaseReplicaIncrease(long[] before, long[] after)
    • getMetaReplicaReadRequests

      private void getMetaReplicaReadRequests(org.apache.hadoop.hbase.regionserver.Region[] metaRegions, long[] counters)
    • testHBaseMetaReplicaGets

      @Test public void testHBaseMetaReplicaGets() throws Exception
      Throws:
      Exception