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.Configurationprivate static org.apache.hadoop.hbase.client.Tableprotected static final org.slf4j.Loggerorg.junit.rules.TestNameprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static org.apache.hadoop.hbase.replication.ReplicationQueueStorageprivate static booleanstatic org.junit.rules.TemporaryFolderprotected static final HBaseTestingUtilFields inherited from class org.apache.hadoop.hbase.replication.TestReplicationBase
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, HBaseTestingUtil utility, org.apache.hadoop.hbase.client.Table... tables) private voidassertBulkLoadConditionsForNoRepFamily(byte[] row, byte[] value, HBaseTestingUtil utility, org.apache.hadoop.hbase.client.Table... tables) protected voidassertTableHasValue(org.apache.hadoop.hbase.client.Table table, byte[] row, byte[] value) private voidassertTableNotHasValue(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, HBaseTestingUtil cluster) private voidbulkLoadOnClusterForNoRepFamily(byte[] row, byte[] value, HBaseTestingUtil cluster) private voidcopyToHdfs(String bulkLoadFilePath, org.apache.hadoop.hdfs.MiniDFSCluster cluster) private voidcopyToHdfsForNoRepFamily(String bulkLoadFilePath, org.apache.hadoop.hdfs.MiniDFSCluster cluster) private StringcreateHFileForFamilies(byte[] row, byte[] value, org.apache.hadoop.conf.Configuration clusterConfig) private StringcreateHFileForNoRepFamilies(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(HBaseTestingUtil cluster) private static voidvoidvoidMethods inherited from class org.apache.hadoop.hbase.replication.TestReplicationBase
addPeer, addPeer, cleanUp, createTable, getClusterKey, isSerialPeer, isSyncPeer, loadData, loadData, removePeer, removePeer, restartSourceCluster, runSimplePutDeleteTest, runSmallBatchTest, setupConfig, stopAllRegionServers, tearDownAfterClass, tearDownBase, 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
-
htable3
-
name
-
testFolder
-
queueStorage
-
replicationPeersAdded
-
-
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(HBaseTestingUtil util) throws UnknownHostException - Throws:
UnknownHostException
-
setupCoprocessor
-
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, HBaseTestingUtil 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, HBaseTestingUtil 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
-
testBulkloadReplicationActiveActiveForNoRepFamily
- Throws:
Exception
-
assertBulkLoadConditionsForNoRepFamily
private void assertBulkLoadConditionsForNoRepFamily(byte[] row, byte[] value, HBaseTestingUtil utility, org.apache.hadoop.hbase.client.Table... tables) throws Exception - Throws:
Exception
-
bulkLoadOnClusterForNoRepFamily
private void bulkLoadOnClusterForNoRepFamily(byte[] row, byte[] value, HBaseTestingUtil cluster) throws Exception - Throws:
Exception
-
createHFileForNoRepFamilies
private String createHFileForNoRepFamilies(byte[] row, byte[] value, org.apache.hadoop.conf.Configuration clusterConfig) throws IOException - Throws:
IOException
-
copyToHdfsForNoRepFamily
private void copyToHdfsForNoRepFamily(String bulkLoadFilePath, org.apache.hadoop.hdfs.MiniDFSCluster cluster) throws Exception - Throws:
Exception
-
assertTableNotHasValue
private void assertTableNotHasValue(org.apache.hadoop.hbase.client.Table table, byte[] row, byte[] value) throws IOException - Throws:
IOException
-