public class TestMetaRegionReplicaReplicationEndpoint extends Object
TestRegionReplicaReplicationEndpoint
Modifier and Type | Field and Description |
---|---|
static HBaseClassTestRule |
CLASS_RULE |
private HBaseTestingUtility |
HTU |
private static org.slf4j.Logger |
LOG |
org.junit.rules.TestName |
name |
private static int |
NB_SERVERS |
private int |
numOfMetaReplica |
private static byte[] |
VALUE |
Constructor and Description |
---|
TestMetaRegionReplicaReplicationEndpoint() |
Modifier and Type | Method and Description |
---|---|
void |
after() |
void |
before() |
(package private) static boolean |
contains(List<org.apache.hadoop.hbase.client.Result> contains,
List<org.apache.hadoop.hbase.Cell> cells)
Presumes sorted Cells.
|
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.
|
private void |
doNGets(org.apache.hadoop.hbase.client.Table table,
byte[][] keys) |
private org.apache.hadoop.hbase.regionserver.Region[] |
getAllRegions(org.apache.hadoop.hbase.TableName tableName,
int replication)
Returns All Regions for tableName including Replicas.
|
private List<org.apache.hadoop.hbase.client.Result> |
getMetaCells(org.apache.hadoop.hbase.TableName tableName)
Scan hbase:meta for
tableName content. |
private void |
getMetaReplicaReadRequests(org.apache.hadoop.hbase.regionserver.Region[] metaRegions,
long[] counters) |
private org.apache.hadoop.hbase.regionserver.Region |
getOneRegion(org.apache.hadoop.hbase.TableName tableName) |
private boolean |
isMetaRegionReplicaReplicationSource(org.apache.hadoop.hbase.regionserver.HRegionServer hrs)
Returns Whether the special meta region replica peer is enabled on
hrs |
private void |
primaryIncreaseReplicaIncrease(long[] before,
long[] after) |
private void |
primaryIncreaseReplicaNoChange(long[] before,
long[] after) |
private void |
primaryMayIncreaseReplicaNoChange(long[] before,
long[] after) |
private void |
primaryNoChangeReplicaIncrease(long[] before,
long[] after) |
void |
testCatalogReplicaReplicationWithFlushAndCompaction() |
void |
testCatalogReplicaReplicationWithReplicaMoved() |
void |
testHBaseMetaReplicaGets() |
void |
testHBaseMetaReplicates()
Test meta region replica replication.
|
private void |
testHBaseMetaReplicatesOneRow(int i)
Test meta region replica replication.
|
void |
testHBaseMetaReplicationSourceCreatedOnOpen()
Assert that the ReplicationSource for hbase:meta gets created when hbase:meta is opened.
|
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).
|
protected void |
verifyReplication(org.apache.hadoop.hbase.TableName tableName,
int regionReplication,
int startRow,
int endRow,
byte[] family) |
private void |
verifyReplication(org.apache.hadoop.hbase.TableName tableName,
int regionReplication,
int startRow,
int endRow,
byte[] family,
boolean present) |
private void |
verifyReplication(org.apache.hadoop.hbase.TableName tableName,
int regionReplication,
List<org.apache.hadoop.hbase.client.Result> contains)
Verify Replicas have results (exactly).
|
private void |
waitForMetaReplicasToOnline()
Replicas come online after primary.
|
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static final int NB_SERVERS
private final HBaseTestingUtility HTU
private int numOfMetaReplica
private static byte[] VALUE
public org.junit.rules.TestName name
public TestMetaRegionReplicaReplicationEndpoint()
public void testHBaseMetaReplicationSourceCreatedOnOpen() throws Exception
Exception
private void testHBaseMetaReplicatesOneRow(int i) throws Exception
Exception
private boolean isMetaRegionReplicaReplicationSource(org.apache.hadoop.hbase.regionserver.HRegionServer hrs)
hrs
public void testHBaseMetaReplicates() throws Exception
Exception
public void testCatalogReplicaReplicationWithFlushAndCompaction() throws Exception
Exception
public void testCatalogReplicaReplicationWithReplicaMoved() throws Exception
Exception
protected void verifyReplication(org.apache.hadoop.hbase.TableName tableName, int regionReplication, int startRow, int endRow, byte[] family) throws Exception
Exception
private void verifyReplication(org.apache.hadoop.hbase.TableName tableName, int regionReplication, int startRow, int endRow, byte[] family, boolean present) throws Exception
Exception
private void waitForMetaReplicasToOnline() throws IOException
IOException
private List<org.apache.hadoop.hbase.client.Result> getMetaCells(org.apache.hadoop.hbase.TableName tableName) throws IOException
tableName
content.IOException
private org.apache.hadoop.hbase.regionserver.Region[] getAllRegions(org.apache.hadoop.hbase.TableName tableName, int replication)
private org.apache.hadoop.hbase.regionserver.Region getOneRegion(org.apache.hadoop.hbase.TableName tableName)
private void verifyDeletedReplication(org.apache.hadoop.hbase.TableName tableName, int regionReplication, org.apache.hadoop.hbase.TableName deletedTableName)
private boolean doesNotContain(List<org.apache.hadoop.hbase.Cell> cells, org.apache.hadoop.hbase.TableName tableName)
cells
.private void verifyReplication(org.apache.hadoop.hbase.TableName tableName, int regionReplication, List<org.apache.hadoop.hbase.client.Result> contains)
static boolean contains(List<org.apache.hadoop.hbase.client.Result> contains, List<org.apache.hadoop.hbase.Cell> cells) throws IOException
cells
has contains
at least.IOException
private void doNGets(org.apache.hadoop.hbase.client.Table table, byte[][] keys) throws Exception
Exception
private void primaryNoChangeReplicaIncrease(long[] before, long[] after)
private void primaryIncreaseReplicaNoChange(long[] before, long[] after)
private void primaryMayIncreaseReplicaNoChange(long[] before, long[] after)
private void primaryIncreaseReplicaIncrease(long[] before, long[] after)
private void getMetaReplicaReadRequests(org.apache.hadoop.hbase.regionserver.Region[] metaRegions, long[] counters)
public void testHBaseMetaReplicaGets() throws Exception
Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.