Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import org.apache.hadoop.hbase.util.Pair;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
Expand Down Expand Up @@ -130,8 +131,8 @@ public static void setUpBeforeAll() throws Exception {
ReplicationPeerConfig peer1Config = getPeerConfigForCluster(UTIL1);
ReplicationPeerConfig peer2Config = getPeerConfigForCluster(UTIL2);
ReplicationPeerConfig peer3Config = getPeerConfigForCluster(UTIL3);
// Setup following topology: "1 <-> 2 <-> 3", 1 -> 2 will be added by setUpBase method in parent
// class
// Set up following topology: "1 <-> 2 <-> 3"
UTIL1.getAdmin().addReplicationPeer(PEER_ID2, peer2Config);
UTIL2.getAdmin().addReplicationPeer(PEER_ID1, peer1Config);
// adds cluster3 as a remote peer on cluster2
UTIL2.getAdmin().addReplicationPeer(PEER_ID3, peer3Config);
Expand Down Expand Up @@ -162,13 +163,20 @@ private static void startThirdCluster() throws Exception {
}

@BeforeEach
public void resetBulkLoadCount() throws Exception {
// removing the peer and adding again causing the previously completed bulk load jobs getting
// submitted again, so here we override the setUpBase and tearDownBase to not adding/removing
// peers between each tests, we will add peers in beforeAll
@Override
public void setUpBase() throws Exception {
// Removing the peer and adding it back causes previously completed bulk-load jobs to be
// resubmitted. Override setUpBase/tearDownBase so we do not add/remove peers between tests;
// peers are added once in @BeforeAll.
BULK_LOADS_COUNT = new AtomicInteger(0);
}

@AfterEach
@Override
public void tearDownBase() throws Exception {
// do not remove PEER_ID2
}
Comment thread
Apache9 marked this conversation as resolved.

private static ReplicationPeerConfig getPeerConfigForCluster(HBaseTestingUtil util)
throws UnknownHostException {
return ReplicationPeerConfig.newBuilder().setClusterKey(util.getRpcConnnectionURI())
Expand Down