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 |
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
Exceptionpublic void testLoopedReplication() throws Exception
BaseReplicationEndpoint.canReplicateToSameCluster() returns false, so the
ReplicationSource should terminate, and no further logs should get enqueuedExceptionpublic void testHFileCyclicReplication() throws Exception
Exceptionprivate org.apache.hadoop.hbase.client.Table[] setUpClusterTablesAndPeers(int numClusters) throws Exception
Exceptionpublic void testCyclicReplication2() throws Exception
Exceptionpublic void testHFileMultiSlaveReplication() throws Exception
Exceptionpublic void testHFileReplicationForConfiguredTableCfs() throws Exception
Exceptionpublic void testCyclicReplication3() throws Exception
Exceptionpublic void tearDown() throws IOException
IOExceptionprivate void startMiniClusters(int numClusters) throws Exception
Exceptionprivate void shutDownMiniClusters() throws Exception
Exceptionprivate void createTableOnClusters(org.apache.hadoop.hbase.client.TableDescriptor table) throws Exception
Exceptionprivate void addPeer(String id, int masterClusterNumber, int slaveClusterNumber) throws Exception
Exceptionprivate void addPeer(String id, int masterClusterNumber, int slaveClusterNumber, String tableCfs) throws Exception
Exceptionprivate void disablePeer(String id, int masterClusterNumber) throws Exception
Exceptionprivate void enablePeer(String id, int masterClusterNumber) throws Exception
Exceptionprivate org.apache.hadoop.hbase.client.Table[] getHTablesOnClusters(org.apache.hadoop.hbase.TableName tableName) throws Exception
Exceptionprivate void validateCounts(org.apache.hadoop.hbase.client.Table[] htables, byte[] type, int[] expectedCounts) throws IOException
IOExceptionprivate int getCount(org.apache.hadoop.hbase.client.Table t, byte[] type) throws IOException
IOExceptionprivate void deleteAndWait(byte[] row, org.apache.hadoop.hbase.client.Table source, org.apache.hadoop.hbase.client.Table target) throws Exception
Exceptionprivate void putAndWait(byte[] row, byte[] fam, org.apache.hadoop.hbase.client.Table source, org.apache.hadoop.hbase.client.Table target) throws Exception
Exceptionprivate 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
Exceptionprivate void wait(int slaveNumber, org.apache.hadoop.hbase.client.Table target, int expectedCount) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprivate void wait(byte[] row, org.apache.hadoop.hbase.client.Table target, boolean isDeleted) throws Exception
Exceptionprivate void rollWALAndWait(HBaseTestingUtility utility, org.apache.hadoop.hbase.TableName table, byte[] row) throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.