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
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from class org.apache.hadoop.hbase.replication.TestReplicationBase
TestReplicationBase.ReplicationEndpointTest -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.apache.hadoop.fs.Pathprivate static CountDownLatchprivate static AtomicIntegerstatic final HBaseClassTestRuleprotected static final org.apache.hadoop.conf.Configurationprotected static final org.slf4j.Loggerorg.junit.rules.TestNameprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringstatic org.junit.rules.TemporaryFolderprotected static final HBaseTestingUtilityFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertBulkLoadConditions(org.apache.hadoop.hbase.TableName tableName, byte[] row, byte[] value, HBaseTestingUtility utility, org.apache.hadoop.hbase.client.Table... tables) protected voidassertTableHasValue(org.apache.hadoop.hbase.client.Table table, byte[] row, byte[] value) protected voidassertTableNoValue(org.apache.hadoop.hbase.client.Table table, byte[] row, byte[] value) protected voidbulkLoadOnCluster(org.apache.hadoop.hbase.TableName tableName, byte[] row, byte[] value, HBaseTestingUtility cluster) private voidcopyToHdfs(String bulkLoadFilePath, org.apache.hadoop.hdfs.MiniDFSCluster cluster) private StringcreateHFileForFamilies(byte[] row, byte[] value, org.apache.hadoop.conf.Configuration clusterConfig) private org.apache.hadoop.hbase.replication.ReplicationPeerConfigvoidstatic voidprotected static voidsetupBulkLoadConfigsForCluster(org.apache.hadoop.conf.Configuration config, String clusterReplicationId) private voidsetupCoprocessor(HBaseTestingUtility cluster) private static voidvoidvoidMethods 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:
setUpBasein classTestReplicationBase- Throws:
Exception
-
getPeerConfigForCluster
private org.apache.hadoop.hbase.replication.ReplicationPeerConfig getPeerConfigForCluster(HBaseTestingUtility util) -
setupCoprocessor
-
tearDownBase
- Overrides:
tearDownBasein 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
-