public class TestMasterReplication extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TestMasterReplication.CoprocessorCounter
Use a coprocessor to count puts and deletes.
|
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.conf.Configuration |
baseConfiguration |
static HBaseClassTestRule |
CLASS_RULE |
private org.apache.hadoop.conf.Configuration[] |
configurations |
private static byte[] |
count |
private static byte[] |
delete |
private static byte[] |
famName |
private static byte[] |
famName1 |
private static org.slf4j.Logger |
LOG |
private org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster |
miniZK |
private static int |
NB_RETRIES |
private static byte[] |
noRepfamName |
private static byte[] |
put |
private static byte[] |
row |
private static byte[] |
row1 |
private static byte[] |
row2 |
private static byte[] |
row3 |
private static byte[] |
row4 |
private static long |
SLEEP_TIME |
private org.apache.hadoop.hbase.client.TableDescriptor |
table |
private static org.apache.hadoop.hbase.TableName |
tableName |
private HBaseTestingUtility[] |
utilities |
Constructor and Description |
---|
TestMasterReplication() |
Modifier and Type | Method and Description |
---|---|
private void |
addPeer(String id,
int masterClusterNumber,
int slaveClusterNumber) |
private void |
addPeer(String id,
int masterClusterNumber,
int slaveClusterNumber,
String tableCfs) |
private void |
close(Closeable... closeables) |
private void |
createTableOnClusters(org.apache.hadoop.hbase.client.TableDescriptor table) |
private void |
deleteAndWait(byte[] row,
org.apache.hadoop.hbase.client.Table source,
org.apache.hadoop.hbase.client.Table target) |
private void |
disablePeer(String id,
int masterClusterNumber) |
private void |
enablePeer(String id,
int masterClusterNumber) |
private int |
getCount(org.apache.hadoop.hbase.client.Table t,
byte[] type) |
private org.apache.hadoop.hbase.client.Table[] |
getHTablesOnClusters(org.apache.hadoop.hbase.TableName tableName) |
private void |
loadAndValidateHFileReplication(String testName,
int masterNumber,
int[] slaveNumbers,
byte[] row,
byte[] fam,
org.apache.hadoop.hbase.client.Table[] tables,
byte[][][] hfileRanges,
int numOfRows,
int[] expectedCounts,
boolean toValidate) |
private void |
putAndWait(byte[] row,
byte[] fam,
org.apache.hadoop.hbase.client.Table source,
org.apache.hadoop.hbase.client.Table target) |
private void |
rollWALAndWait(HBaseTestingUtility utility,
org.apache.hadoop.hbase.TableName table,
byte[] row) |
void |
setUp() |
private org.apache.hadoop.hbase.client.Table[] |
setUpClusterTablesAndPeers(int numClusters) |
private void |
shutDownMiniClusters() |
private void |
startMiniClusters(int numClusters) |
void |
tearDown() |
void |
testBasePeerConfigsForPeerMutations()
Tests that base replication peer configs are applied on peer creation
and the configs are overriden if updated as part of updateReplicationPeerConfig()
|
void |
testCyclicReplication1()
It tests the replication scenario involving 0 -> 1 -> 0.
|
void |
testCyclicReplication2()
Tests the cyclic replication scenario of 0 -> 1 -> 2 -> 0 by adding and deleting rows to a
table in each clusters and ensuring that the each of these clusters get the appropriate
mutations.
|
void |
testCyclicReplication3()
Tests cyclic replication scenario of 0 -> 1 -> 2 -> 1.
|
void |
testHFileCyclicReplication()
It tests the replication scenario involving 0 -> 1 -> 0.
|
void |
testHFileMultiSlaveReplication()
It tests the multi slave hfile replication scenario involving 0 -> 1, 2.
|
void |
testHFileReplicationForConfiguredTableCfs()
It tests the bulk loaded hfile replication scenario to only explicitly specified table column
families.
|
void |
testLoopedReplication()
Tests the replication scenario 0 -> 0.
|
private void |
validateCounts(org.apache.hadoop.hbase.client.Table[] htables,
byte[] type,
int[] expectedCounts) |
private void |
wait(byte[] row,
org.apache.hadoop.hbase.client.Table target,
boolean isDeleted) |
private void |
wait(int slaveNumber,
org.apache.hadoop.hbase.client.Table target,
int expectedCount) |
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private org.apache.hadoop.conf.Configuration baseConfiguration
private HBaseTestingUtility[] utilities
private org.apache.hadoop.conf.Configuration[] configurations
private org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster miniZK
private static final long SLEEP_TIME
private static final int NB_RETRIES
private static final org.apache.hadoop.hbase.TableName tableName
private static final byte[] famName
private static final byte[] famName1
private static final byte[] row
private static final byte[] row1
private static final byte[] row2
private static final byte[] row3
private static final byte[] row4
private static final byte[] noRepfamName
private static final byte[] count
private static final byte[] put
private static final byte[] delete
private org.apache.hadoop.hbase.client.TableDescriptor table
public TestMasterReplication()
public void testCyclicReplication1() throws Exception
Exception
public void testLoopedReplication() throws Exception
HBaseInterClusterReplicationEndpoint
,
the replication peer should not be added.Exception
public void testHFileCyclicReplication() throws Exception
Exception
private org.apache.hadoop.hbase.client.Table[] setUpClusterTablesAndPeers(int numClusters) throws Exception
Exception
public void testCyclicReplication2() throws Exception
Exception
public void testHFileMultiSlaveReplication() throws Exception
Exception
public void testHFileReplicationForConfiguredTableCfs() throws Exception
Exception
public void testCyclicReplication3() throws Exception
Exception
public void testBasePeerConfigsForPeerMutations() throws Exception
Exception
public void tearDown() throws IOException
IOException
private void startMiniClusters(int numClusters) throws Exception
Exception
private void shutDownMiniClusters() throws Exception
Exception
private void createTableOnClusters(org.apache.hadoop.hbase.client.TableDescriptor table) throws Exception
Exception
private void addPeer(String id, int masterClusterNumber, int slaveClusterNumber) throws Exception
Exception
private void addPeer(String id, int masterClusterNumber, int slaveClusterNumber, String tableCfs) throws Exception
Exception
private void disablePeer(String id, int masterClusterNumber) throws Exception
Exception
private void enablePeer(String id, int masterClusterNumber) throws Exception
Exception
private org.apache.hadoop.hbase.client.Table[] getHTablesOnClusters(org.apache.hadoop.hbase.TableName tableName) throws Exception
Exception
private void validateCounts(org.apache.hadoop.hbase.client.Table[] htables, byte[] type, int[] expectedCounts) throws IOException
IOException
private int getCount(org.apache.hadoop.hbase.client.Table t, byte[] type) throws IOException
IOException
private void deleteAndWait(byte[] row, org.apache.hadoop.hbase.client.Table source, org.apache.hadoop.hbase.client.Table target) throws Exception
Exception
private void putAndWait(byte[] row, byte[] fam, org.apache.hadoop.hbase.client.Table source, org.apache.hadoop.hbase.client.Table target) throws Exception
Exception
private void loadAndValidateHFileReplication(String testName, int masterNumber, int[] slaveNumbers, byte[] row, byte[] fam, org.apache.hadoop.hbase.client.Table[] tables, byte[][][] hfileRanges, int numOfRows, int[] expectedCounts, boolean toValidate) throws Exception
Exception
private void wait(int slaveNumber, org.apache.hadoop.hbase.client.Table target, int expectedCount) throws IOException, InterruptedException
IOException
InterruptedException
private void wait(byte[] row, org.apache.hadoop.hbase.client.Table target, boolean isDeleted) throws Exception
Exception
private void rollWALAndWait(HBaseTestingUtility utility, org.apache.hadoop.hbase.TableName table, byte[] row) throws IOException
IOException
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.