> entry : newQueues.entrySet()) {
String peerId = entry.getKey();
try {
- ReplicationSourceInterface src = getReplicationSource(conf,
- fs, ReplicationSourceManager.this, stopper, replicating, peerId);
+ ReplicationSourceInterface src =
+ getReplicationSource(conf, fs, ReplicationSourceManager.this, stopper, peerId);
if (!zkHelper.getPeerClusters().contains((src.getPeerClusterId()))) {
src.terminate("Recovered queue doesn't belong to any current peer");
break;
diff --git a/hbase-server/src/main/javadoc/org/apache/hadoop/hbase/replication/package.html b/hbase-server/src/main/javadoc/org/apache/hadoop/hbase/replication/package.html
index b97a1a6..0029c75 100644
--- a/hbase-server/src/main/javadoc/org/apache/hadoop/hbase/replication/package.html
+++ b/hbase-server/src/main/javadoc/org/apache/hadoop/hbase/replication/package.html
@@ -132,16 +132,6 @@ Choosing peer 10.10.1.49:62020
In this case it indicates that 1 region server from the slave cluster
was chosen for replication.
-
-Should you want to stop the replication while the clusters are running, open
-the shell on the master cluster and issue this command:
-
-hbase(main):001:0> stop_replication
-
-Replication of already queued edits will still happen after you
-issued that command but new entries won't be. To start it back, simply replace
-"false" with "true" in the command.
-
diff --git a/hbase-server/src/main/ruby/hbase/replication_admin.rb b/hbase-server/src/main/ruby/hbase/replication_admin.rb
index c0fd5b9..27d141a 100644
--- a/hbase-server/src/main/ruby/hbase/replication_admin.rb
+++ b/hbase-server/src/main/ruby/hbase/replication_admin.rb
@@ -65,17 +65,5 @@ module Hbase
def disable_peer(id)
@replication_admin.disablePeer(id)
end
-
- #----------------------------------------------------------------------------------------------
- # Restart the replication, in an unknown state
- def start_replication
- @replication_admin.setReplicating(true)
- end
-
- #----------------------------------------------------------------------------------------------
- # Kill switch for replication, stops all its features
- def stop_replication
- @replication_admin.setReplicating(false)
- end
end
end
diff --git a/hbase-server/src/main/ruby/shell.rb b/hbase-server/src/main/ruby/shell.rb
index 1ba9e02..8902705 100644
--- a/hbase-server/src/main/ruby/shell.rb
+++ b/hbase-server/src/main/ruby/shell.rb
@@ -297,15 +297,13 @@ Shell.load_command_group(
Shell.load_command_group(
'replication',
:full_name => 'CLUSTER REPLICATION TOOLS',
- :comment => "In order to use these tools, hbase.replication must be true. enabling/disabling is currently unsupported",
+ :comment => "In order to use these tools, hbase.replication configuration parameter must be true.",
:commands => %w[
add_peer
remove_peer
list_peers
enable_peer
disable_peer
- start_replication
- stop_replication
]
)
diff --git a/hbase-server/src/main/ruby/shell/commands/start_replication.rb b/hbase-server/src/main/ruby/shell/commands/start_replication.rb
deleted file mode 100644
index 3ea97a9..0000000
--- a/hbase-server/src/main/ruby/shell/commands/start_replication.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-module Shell
- module Commands
- class StartReplication < Command
- def help
- return <<-EOF
-Restarts all the replication features. The state in which each
-stream starts in is undetermined.
-WARNING:
-start/stop replication is only meant to be used in critical load situations.
-Examples:
-
- hbase> start_replication
-EOF
- end
-
- def command
- format_simple_command do
- replication_admin.start_replication
- end
- end
- end
- end
-end
diff --git a/hbase-server/src/main/ruby/shell/commands/stop_replication.rb b/hbase-server/src/main/ruby/shell/commands/stop_replication.rb
deleted file mode 100644
index 2e24fa5..0000000
--- a/hbase-server/src/main/ruby/shell/commands/stop_replication.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-module Shell
- module Commands
- class StopReplication < Command
- def help
- return <<-EOF
-Stops all the replication features. The state in which each
-stream stops in is undetermined.
-WARNING:
-start/stop replication is only meant to be used in critical load situations.
-Examples:
-
- hbase> stop_replication
-EOF
- end
-
- def command
- format_simple_command do
- replication_admin.stop_replication
- end
- end
- end
- end
-end
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java
index 5205d12..06843df 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java
@@ -68,8 +68,7 @@ public class TestLogsCleaner {
conf.setBoolean(HConstants.REPLICATION_ENABLE_KEY, true);
Replication.decorateMasterConfiguration(conf);
Server server = new DummyServer();
- ReplicationZookeeper zkHelper =
- new ReplicationZookeeper(server, new AtomicBoolean(true));
+ ReplicationZookeeper zkHelper = new ReplicationZookeeper(server);
Path oldLogDir = new Path(TEST_UTIL.getDataTestDir(),
HConstants.HREGION_OLDLOGDIR_NAME);
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/ReplicationSourceDummy.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/ReplicationSourceDummy.java
index f06e947..743a176 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/ReplicationSourceDummy.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/ReplicationSourceDummy.java
@@ -38,10 +38,8 @@ public class ReplicationSourceDummy implements ReplicationSourceInterface {
Path currentPath;
@Override
- public void init(Configuration conf, FileSystem fs,
- ReplicationSourceManager manager, Stoppable stopper,
- AtomicBoolean replicating, String peerClusterId)
- throws IOException {
+ public void init(Configuration conf, FileSystem fs, ReplicationSourceManager manager,
+ Stoppable stopper, String peerClusterId) throws IOException {
this.manager = manager;
this.peerClusterId = peerClusterId;
}
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java
index e2bfa3b..3acb3ed 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java
@@ -111,7 +111,6 @@ public class TestReplicationBase {
zkw2 = new ZooKeeperWatcher(conf2, "cluster2", null, true);
admin.addPeer("2", utility2.getClusterKey());
- setIsReplication(true);
LOG.info("Setup second Zk");
CONF_WITH_LOCALFS = HBaseConfiguration.create(conf1);
@@ -134,12 +133,6 @@ public class TestReplicationBase {
htable2 = new HTable(conf2, tableName);
}
- protected static void setIsReplication(boolean rep) throws Exception {
- LOG.info("Set rep " + rep);
- admin.setReplicating(rep);
- Thread.sleep(SLEEP_TIME);
- }
-
/**
* @throws java.lang.Exception
*/
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java
index ddbd56d..538c2df 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java
@@ -256,75 +256,6 @@ public class TestReplicationSmallTests extends TestReplicationBase {
}
/**
- * Test stopping replication, trying to insert, make sure nothing's
- * replicated, enable it, try replicating and it should work
- * @throws Exception
- */
- @Test(timeout=300000)
- public void testStartStop() throws Exception {
-
- // Test stopping replication
- setIsReplication(false);
-
- Put put = new Put(Bytes.toBytes("stop start"));
- put.add(famName, row, row);
- htable1.put(put);
-
- Get get = new Get(Bytes.toBytes("stop start"));
- for (int i = 0; i < NB_RETRIES; i++) {
- if (i==NB_RETRIES-1) {
- break;
- }
- Result res = htable2.get(get);
- if(res.size() >= 1) {
- fail("Replication wasn't stopped");
-
- } else {
- LOG.info("Row not replicated, let's wait a bit more...");
- Thread.sleep(SLEEP_TIME);
- }
- }
-
- // Test restart replication
- setIsReplication(true);
-
- htable1.put(put);
-
- for (int i = 0; i < NB_RETRIES; i++) {
- if (i==NB_RETRIES-1) {
- fail("Waited too much time for put replication");
- }
- Result res = htable2.get(get);
- if(res.size() == 0) {
- LOG.info("Row not available");
- Thread.sleep(SLEEP_TIME);
- } else {
- assertArrayEquals(res.value(), row);
- break;
- }
- }
-
- put = new Put(Bytes.toBytes("do not rep"));
- put.add(noRepfamName, row, row);
- htable1.put(put);
-
- get = new Get(Bytes.toBytes("do not rep"));
- for (int i = 0; i < NB_RETRIES; i++) {
- if (i == NB_RETRIES-1) {
- break;
- }
- Result res = htable2.get(get);
- if (res.size() >= 1) {
- fail("Not supposed to be replicated");
- } else {
- LOG.info("Row not replicated, let's wait a bit more...");
- Thread.sleep(SLEEP_TIME);
- }
- }
-
- }
-
- /**
* Test disable/enable replication, trying to insert, make sure nothing's
* replicated, enable it, the insert should be replicated
*
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStateZKImpl.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStateZKImpl.java
index 137cf40..077a504 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStateZKImpl.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationStateZKImpl.java
@@ -69,10 +69,6 @@ public class TestReplicationStateZKImpl extends TestReplicationStateBasic {
Configuration testConf = new Configuration(conf);
testConf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, baseZKNode);
ZooKeeperWatcher zkw1 = new ZooKeeperWatcher(testConf, "test1", null);
- ReplicationStateInterface rsi = new ReplicationStateImpl(zkw1, testConf, zkw1);
- rsi.init();
- rsi.setState(true);
- rsi.close();
String fakeRs = ZKUtil.joinZNode(zkw1.rsZNode, "hostname1.example.org:1234");
ZKUtil.createWithParents(zkw1, fakeRs);
ZKClusterId.setClusterId(zkw1, new ClusterId());
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationZookeeper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationZookeeper.java
index c61cf57..de2515c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationZookeeper.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationZookeeper.java
@@ -62,7 +62,7 @@ public class TestReplicationZookeeper {
conf = utility.getConfiguration();
zkw = HBaseTestingUtility.getZooKeeperWatcher(utility);
DummyServer server = new DummyServer();
- repZk = new ReplicationZookeeper(server, new AtomicBoolean());
+ repZk = new ReplicationZookeeper(server);
slaveClusterKey = conf.get(HConstants.ZOOKEEPER_QUORUM) + ":" +
conf.get("hbase.zookeeper.property.clientPort") + ":/1";
String replicationZNodeName = conf.get("zookeeper.znode.replication", "replication");
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java
index 2d334e6..1189162 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java
@@ -28,7 +28,6 @@ import java.util.List;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -227,8 +226,7 @@ public class TestReplicationSourceManager {
LOG.debug("testNodeFailoverWorkerCopyQueuesFromRSUsingMulti");
conf.setBoolean(HConstants.ZOOKEEPER_USEMULTI, true);
final Server server = new DummyServer("hostname0.example.org");
- AtomicBoolean replicating = new AtomicBoolean(true);
- ReplicationZookeeper rz = new ReplicationZookeeper(server, replicating);
+ ReplicationZookeeper rz = new ReplicationZookeeper(server);
// populate some znodes in the peer znode
files.add("log1");
files.add("log2");
@@ -260,8 +258,6 @@ public class TestReplicationSourceManager {
populatedMap += w1.isLogZnodesMapPopulated() + w2.isLogZnodesMapPopulated()
+ w3.isLogZnodesMapPopulated();
assertEquals(1, populatedMap);
- // close out the resources.
- rz.close();
server.abort("", null);
}
@@ -270,8 +266,7 @@ public class TestReplicationSourceManager {
LOG.debug("testNodeFailoverDeadServerParsing");
conf.setBoolean(HConstants.ZOOKEEPER_USEMULTI, true);
final Server server = new DummyServer("ec2-54-234-230-108.compute-1.amazonaws.com");
- AtomicBoolean replicating = new AtomicBoolean(true);
- ReplicationZookeeper rz = new ReplicationZookeeper(server, replicating);
+ ReplicationZookeeper rz = new ReplicationZookeeper(server);
// populate some znodes in the peer znode
files.add("log1");
files.add("log2");
@@ -285,16 +280,13 @@ public class TestReplicationSourceManager {
Server s3 = new DummyServer("ec2-23-20-187-167.compute-1.amazonaws.com");
// simulate three servers fail sequentially
- ReplicationZookeeper rz1 = new ReplicationZookeeper(s1, new AtomicBoolean(true));
+ ReplicationZookeeper rz1 = new ReplicationZookeeper(s1);
SortedMap> testMap =
rz1.claimQueues(server.getServerName().getServerName());
- rz1.close();
- ReplicationZookeeper rz2 = new ReplicationZookeeper(s2, new AtomicBoolean(true));
+ ReplicationZookeeper rz2 = new ReplicationZookeeper(s2);
testMap = rz2.claimQueues(s1.getServerName().getServerName());
- rz2.close();
- ReplicationZookeeper rz3 = new ReplicationZookeeper(s3, new AtomicBoolean(true));
+ ReplicationZookeeper rz3 = new ReplicationZookeeper(s3);
testMap = rz3.claimQueues(s2.getServerName().getServerName());
- rz3.close();
ReplicationQueueInfo replicationQueueInfo = new ReplicationQueueInfo(testMap.firstKey());
List result = replicationQueueInfo.getDeadRegionServers();
@@ -303,9 +295,7 @@ public class TestReplicationSourceManager {
assertTrue(result.contains(server.getServerName().getServerName()));
assertTrue(result.contains(s1.getServerName().getServerName()));
assertTrue(result.contains(s2.getServerName().getServerName()));
-
- // close out the resources.
- rz.close();
+
server.abort("", null);
}
@@ -319,14 +309,13 @@ public class TestReplicationSourceManager {
public DummyNodeFailoverWorker(String znode, Server s) throws Exception {
this.deadRsZnode = znode;
this.server = s;
- rz = new ReplicationZookeeper(server, new AtomicBoolean(true));
+ rz = new ReplicationZookeeper(server);
}
@Override
public void run() {
try {
logZnodesMap = rz.claimQueues(deadRsZnode);
- rz.close();
server.abort("Done with testing", null);
} catch (Exception e) {
LOG.error("Got exception while running NodeFailoverWorker", e);