Class TestBulkLoadReplication
java.lang.Object
org.apache.hadoop.hbase.replication.TestReplicationBase
org.apache.hadoop.hbase.regionserver.TestBulkLoadReplication
- Direct Known Subclasses:
TestNamespaceReplicationWithBulkLoadedData
Integration test for bulk load replication. Defines three clusters, with the following
replication topology: "1 <-> 2 <-> 3" (active-active between 1 and 2, and active-active between 2
and 3). For each of defined test clusters, it performs a bulk load, asserting values on bulk
loaded file gets replicated to other two peers. Since we are doing 3 bulk loads, with the given
replication topology all these bulk loads should get replicated only once on each peer. To assert
this, this test defines a preBulkLoad coprocessor and adds it to all test table regions, on each
of the clusters. This CP counts the amount of times bulk load actually gets invoked, certifying
we are not entering the infinite loop condition addressed by HBASE-22380.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.replication.TestReplicationBase
TestReplicationBase.ReplicationEndpointTest
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.apache.hadoop.fs.Path
private static CountDownLatch
private static AtomicInteger
static final HBaseClassTestRule
protected static final org.apache.hadoop.conf.Configuration
protected static final org.slf4j.Logger
org.junit.rules.TestName
private static final String
private static final String
private static final String
private static final String
private static final String
static org.junit.rules.TemporaryFolder
protected static final HBaseTestingUtility
Fields inherited from class org.apache.hadoop.hbase.replication.TestReplicationBase
admin, CONF_WITH_LOCALFS, CONF1, CONF2, connection1, connection2, famName, hbaseAdmin, htable1, htable2, NB_RETRIES, NB_ROWS_IN_BATCH, NB_ROWS_IN_BIG_BATCH, noRepfamName, NUM_SLAVES1, NUM_SLAVES2, PEER_ID2, replicateCount, replicatedEntries, row, SLEEP_TIME, tableName, UTIL1, UTIL2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
assertBulkLoadConditions
(org.apache.hadoop.hbase.TableName tableName, byte[] row, byte[] value, HBaseTestingUtility utility, org.apache.hadoop.hbase.client.Table... tables) protected void
assertTableHasValue
(org.apache.hadoop.hbase.client.Table table, byte[] row, byte[] value) protected void
assertTableNoValue
(org.apache.hadoop.hbase.client.Table table, byte[] row, byte[] value) protected void
bulkLoadOnCluster
(org.apache.hadoop.hbase.TableName tableName, byte[] row, byte[] value, HBaseTestingUtility cluster) private void
copyToHdfs
(String bulkLoadFilePath, org.apache.hadoop.hdfs.MiniDFSCluster cluster) private String
createHFileForFamilies
(byte[] row, byte[] value, org.apache.hadoop.conf.Configuration clusterConfig) private org.apache.hadoop.hbase.replication.ReplicationPeerConfig
void
static void
protected static void
setupBulkLoadConfigsForCluster
(org.apache.hadoop.conf.Configuration config, String clusterReplicationId) private void
setupCoprocessor
(HBaseTestingUtility cluster) private static void
void
void
Methods inherited from class org.apache.hadoop.hbase.replication.TestReplicationBase
addPeer, cleanUp, createTable, isSerialPeer, loadData, loadData, removePeer, runSimplePutDeleteTest, runSmallBatchTest, setupConfig, tearDownAfterClass, waitForReplication, waitForReplication
-
Field Details
-
CLASS_RULE
-
LOG
-
PEER1_CLUSTER_ID
- See Also:
-
PEER2_CLUSTER_ID
- See Also:
-
PEER3_CLUSTER_ID
- See Also:
-
PEER_ID1
- See Also:
-
PEER_ID3
- See Also:
-
BULK_LOADS_COUNT
-
BULK_LOAD_LATCH
-
UTIL3
-
CONF3
-
BULK_LOAD_BASE_DIR
-
name
-
testFolder
-
-
Constructor Details
-
TestBulkLoadReplication
public TestBulkLoadReplication()
-
-
Method Details
-
setUpBeforeClass
- Throws:
Exception
-
startThirdCluster
- Throws:
Exception
-
setUpBase
- Overrides:
setUpBase
in classTestReplicationBase
- Throws:
Exception
-
getPeerConfigForCluster
private org.apache.hadoop.hbase.replication.ReplicationPeerConfig getPeerConfigForCluster(HBaseTestingUtility util) -
setupCoprocessor
-
tearDownBase
- Overrides:
tearDownBase
in classTestReplicationBase
- Throws:
Exception
-
setupBulkLoadConfigsForCluster
protected static void setupBulkLoadConfigsForCluster(org.apache.hadoop.conf.Configuration config, String clusterReplicationId) throws Exception - Throws:
Exception
-
testBulkLoadReplicationActiveActive
- Throws:
Exception
-
assertBulkLoadConditions
protected void assertBulkLoadConditions(org.apache.hadoop.hbase.TableName tableName, byte[] row, byte[] value, HBaseTestingUtility utility, org.apache.hadoop.hbase.client.Table... tables) throws Exception - Throws:
Exception
-
bulkLoadOnCluster
protected void bulkLoadOnCluster(org.apache.hadoop.hbase.TableName tableName, byte[] row, byte[] value, HBaseTestingUtility cluster) throws Exception - Throws:
Exception
-
copyToHdfs
private void copyToHdfs(String bulkLoadFilePath, org.apache.hadoop.hdfs.MiniDFSCluster cluster) throws Exception - Throws:
Exception
-
assertTableHasValue
protected void assertTableHasValue(org.apache.hadoop.hbase.client.Table table, byte[] row, byte[] value) throws Exception - Throws:
Exception
-
assertTableNoValue
protected void assertTableNoValue(org.apache.hadoop.hbase.client.Table table, byte[] row, byte[] value) throws Exception - Throws:
Exception
-
createHFileForFamilies
private String createHFileForFamilies(byte[] row, byte[] value, org.apache.hadoop.conf.Configuration clusterConfig) throws IOException - Throws:
IOException
-