From 26e6c2ceb4db80e561ec321dba52673e7f285d1b Mon Sep 17 00:00:00 2001 From: Apekshit Sharma Date: Thu, 17 Aug 2017 20:59:35 -0700 Subject: [PATCH] HBASE-17442 Move most of the replication related classes from hbase-client to new hbase-replication package. (Guanghao Zhang). Change-Id: Ie0e24cc617ab4bf56de8b1747062d1b78a5d4669 --- .../client/replication/ReplicationAdmin.java | 102 +------ .../apache/hadoop/hbase/zookeeper/ZKUtil.java | 14 +- .../hadoop/hbase/zookeeper/ZNodePaths.java | 22 +- hbase-replication/pom.xml | 264 ++++++++++++++++++ .../hbase/replication/ReplicationFactory.java | 0 .../replication/ReplicationListener.java | 0 .../hbase/replication/ReplicationPeer.java | 0 .../ReplicationPeerConfigListener.java | 0 .../replication/ReplicationPeerZKImpl.java | 0 .../hbase/replication/ReplicationPeers.java | 0 .../replication/ReplicationPeersZKImpl.java | 0 .../replication/ReplicationQueueInfo.java | 0 .../hbase/replication/ReplicationQueues.java | 0 .../ReplicationQueuesArguments.java | 0 .../replication/ReplicationQueuesClient.java | 0 .../ReplicationQueuesClientArguments.java | 0 .../ReplicationQueuesClientZKImpl.java | 0 .../replication/ReplicationQueuesZKImpl.java | 0 .../replication/ReplicationStateZKBase.java | 0 .../replication/ReplicationTableBase.java | 0 .../hbase/replication/ReplicationTracker.java | 0 .../replication/ReplicationTrackerZKImpl.java | 0 ...TableBasedReplicationQueuesClientImpl.java | 0 .../TableBasedReplicationQueuesImpl.java | 0 hbase-server/pom.xml | 4 + .../replication/BaseReplicationEndpoint.java | 2 - pom.xml | 6 + 27 files changed, 301 insertions(+), 113 deletions(-) create mode 100644 hbase-replication/pom.xml rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationFactory.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationListener.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfigListener.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerZKImpl.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeers.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueueInfo.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesArguments.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClient.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientArguments.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientZKImpl.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesZKImpl.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateZKBase.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTableBase.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTracker.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTrackerZKImpl.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesClientImpl.java (100%) rename {hbase-client => hbase-replication}/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java (100%) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java index 752d18c2ff9..615a79d3747 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java @@ -26,37 +26,22 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import java.util.TreeMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.Abortable; -import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.ReplicationPeerNotFoundException; import org.apache.hadoop.hbase.TableName; -import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; -import org.apache.hadoop.hbase.client.HBaseAdmin; -import org.apache.hadoop.hbase.client.RegionLocator; import org.apache.hadoop.hbase.replication.ReplicationException; -import org.apache.hadoop.hbase.replication.ReplicationFactory; -import org.apache.hadoop.hbase.replication.ReplicationPeer; import org.apache.hadoop.hbase.replication.ReplicationPeerConfig; import org.apache.hadoop.hbase.replication.ReplicationPeerDescription; -import org.apache.hadoop.hbase.replication.ReplicationPeerZKImpl; -import org.apache.hadoop.hbase.replication.ReplicationPeers; -import org.apache.hadoop.hbase.replication.ReplicationQueuesClient; -import org.apache.hadoop.hbase.replication.ReplicationQueuesClientArguments; -import org.apache.hadoop.hbase.util.Pair; -import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting; import org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists; @@ -101,16 +86,6 @@ public class ReplicationAdmin implements Closeable { Integer.toString(HConstants.REPLICATION_SCOPE_SERIAL); private final Connection connection; - // TODO: replication should be managed by master. All the classes except ReplicationAdmin should - // be moved to hbase-server. Resolve it in HBASE-11392. - private final ReplicationQueuesClient replicationQueuesClient; - private final ReplicationPeers replicationPeers; - /** - * A watcher used by replicationPeers and replicationQueuesClient. Keep reference so can dispose - * on {@link #close()}. - */ - private final ZooKeeperWatcher zkw; - private Admin admin; /** @@ -122,49 +97,6 @@ public class ReplicationAdmin implements Closeable { public ReplicationAdmin(Configuration conf) throws IOException { this.connection = ConnectionFactory.createConnection(conf); admin = connection.getAdmin(); - try { - zkw = createZooKeeperWatcher(); - try { - this.replicationQueuesClient = - ReplicationFactory.getReplicationQueuesClient(new ReplicationQueuesClientArguments(conf, - this.connection, zkw)); - this.replicationQueuesClient.init(); - this.replicationPeers = ReplicationFactory.getReplicationPeers(zkw, conf, - this.replicationQueuesClient, this.connection); - this.replicationPeers.init(); - } catch (Exception exception) { - if (zkw != null) { - zkw.close(); - } - throw exception; - } - } catch (Exception exception) { - connection.close(); - if (exception instanceof IOException) { - throw (IOException) exception; - } else if (exception instanceof RuntimeException) { - throw (RuntimeException) exception; - } else { - throw new IOException("Error initializing the replication admin client.", exception); - } - } - } - - private ZooKeeperWatcher createZooKeeperWatcher() throws IOException { - // This Abortable doesn't 'abort'... it just logs. - return new ZooKeeperWatcher(connection.getConfiguration(), "ReplicationAdmin", new Abortable() { - @Override - public void abort(String why, Throwable e) { - LOG.error(why, e); - // We used to call system.exit here but this script can be embedded by other programs that - // want to do replication stuff... so inappropriate calling System.exit. Just log for now. - } - - @Override - public boolean isAborted() { - return false; - } - }); } /** @@ -452,9 +384,6 @@ public class ReplicationAdmin implements Closeable { @Override public void close() throws IOException { - if (this.zkw != null) { - this.zkw.close(); - } if (this.connection != null) { this.connection.close(); } @@ -518,40 +447,13 @@ public class ReplicationAdmin implements Closeable { admin.disableTableReplication(tableName); } - @VisibleForTesting - @Deprecated - public void peerAdded(String id) throws ReplicationException { - this.replicationPeers.peerConnected(id); - } - /** * @deprecated use {@link org.apache.hadoop.hbase.client.Admin#listReplicationPeers()} instead */ @VisibleForTesting @Deprecated - List listReplicationPeers() throws IOException { - Map peers = listPeerConfigs(); - if (peers == null || peers.size() <= 0) { - return null; - } - List listOfPeers = new ArrayList<>(peers.size()); - for (Entry peerEntry : peers.entrySet()) { - String peerId = peerEntry.getKey(); - try { - Pair pair = this.replicationPeers.getPeerConf(peerId); - Configuration peerConf = pair.getSecond(); - ReplicationPeer peer = new ReplicationPeerZKImpl(zkw, pair.getSecond(), - peerId, pair.getFirst(), this.connection); - listOfPeers.add(peer); - } catch (ReplicationException e) { - LOG.warn("Failed to get valid replication peers. " - + "Error connecting to peer cluster with peerId=" + peerId + ". Error message=" - + e.getMessage()); - LOG.debug("Failure details to get valid replication peers.", e); - continue; - } - } - return listOfPeers; + List listReplicationPeers() throws IOException { + return admin.listReplicationPeers(); } /** diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java index dafe421bcd8..1de3652d65c 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java @@ -44,7 +44,6 @@ import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.exceptions.DeserializationException; -import org.apache.hadoop.hbase.replication.ReplicationStateZKBase; import org.apache.hadoop.hbase.security.Superusers; import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.hbase.shaded.com.google.protobuf.UnsafeByteOperations; @@ -1772,23 +1771,18 @@ public class ZKUtil { */ private static void getReplicationZnodesDump(ZooKeeperWatcher zkw, StringBuilder sb) throws KeeperException { - String replicationZNodeName = zkw.getConfiguration().get("zookeeper.znode.replication", - "replication"); - String replicationZnode = joinZNode(zkw.znodePaths.baseZNode, replicationZNodeName); + String replicationZnode = zkw.znodePaths.replicationZNode; if (ZKUtil.checkExists(zkw, replicationZnode) == -1) return; // do a ls -r on this znode sb.append("\n").append(replicationZnode).append(": "); List children = ZKUtil.listChildrenNoWatch(zkw, replicationZnode); for (String child : children) { String znode = joinZNode(replicationZnode, child); - if (child.equals(zkw.getConfiguration().get("zookeeper.znode.replication.peers", "peers"))) { + if (znode.equals(zkw.znodePaths.peersZNode)) { appendPeersZnodes(zkw, znode, sb); - } else if (child.equals(zkw.getConfiguration(). - get("zookeeper.znode.replication.rs", "rs"))) { + } else if (znode.equals(zkw.znodePaths.queuesZNode)) { appendRSZnodes(zkw, znode, sb); - } else if (child.equals(zkw.getConfiguration().get( - ReplicationStateZKBase.ZOOKEEPER_ZNODE_REPLICATION_HFILE_REFS_KEY, - ReplicationStateZKBase.ZOOKEEPER_ZNODE_REPLICATION_HFILE_REFS_DEFAULT))) { + } else if (znode.equals(zkw.znodePaths.hfileRefsZNode)) { appendHFileRefsZnodes(zkw, znode, sb); } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZNodePaths.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZNodePaths.java index 4c66b8f8153..5608eb5d2a8 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZNodePaths.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZNodePaths.java @@ -79,6 +79,15 @@ public class ZNodePaths { // znode of indicating master maintenance mode public final String masterMaintZNode; + // znode containing all replication state. + public final String replicationZNode; + // znode containing a list of all remote slave (i.e. peer) clusters. + public final String peersZNode; + // znode containing all replication queues + public final String queuesZNode; + // znode containing queues of hfile references to be replicated + public final String hfileRefsZNode; + public ZNodePaths(Configuration conf) { baseZNode = conf.get(ZOOKEEPER_ZNODE_PARENT, DEFAULT_ZOOKEEPER_ZNODE_PARENT); ImmutableMap.Builder builder = ImmutableMap.builder(); @@ -113,6 +122,15 @@ public class ZNodePaths { conf.get("zookeeper.znode.namespace", "namespace")); masterMaintZNode = ZKUtil.joinZNode(baseZNode, conf.get("zookeeper.znode.masterMaintenance", "master-maintenance")); + replicationZNode = + ZKUtil.joinZNode(baseZNode, conf.get("zookeeper.znode.replication", "replication")); + peersZNode = + ZKUtil.joinZNode(replicationZNode, conf.get("zookeeper.znode.replication.peers", "peers")); + queuesZNode = + ZKUtil.joinZNode(replicationZNode, conf.get("zookeeper.znode.replication.rs", "rs")); + hfileRefsZNode = + ZKUtil.joinZNode(replicationZNode, + conf.get("zookeeper.znode.replication.hfile.refs", "hfile-refs")); } @Override @@ -125,7 +143,9 @@ public class ZNodePaths { + ", balancerZNode=" + balancerZNode + ", regionNormalizerZNode=" + regionNormalizerZNode + ", switchZNode=" + switchZNode + ", tableLockZNode=" + tableLockZNode + ", recoveringRegionsZNode=" + recoveringRegionsZNode + ", namespaceZNode=" - + namespaceZNode + ", masterMaintZNode=" + masterMaintZNode + "]"; + + namespaceZNode + ", masterMaintZNode=" + masterMaintZNode + ", replicationZNode=" + + replicationZNode + ", peersZNode=" + peersZNode + ", queuesZNode=" + queuesZNode + + ", hfileRefsZNode=" + hfileRefsZNode + "]"; } /** diff --git a/hbase-replication/pom.xml b/hbase-replication/pom.xml new file mode 100644 index 00000000000..858e9fc1f80 --- /dev/null +++ b/hbase-replication/pom.xml @@ -0,0 +1,264 @@ + + + + 4.0.0 + + hbase-build-configuration + org.apache.hbase + 3.0.0-SNAPSHOT + .. + + hbase-replication + Apache HBase - Replication + HBase Replication Support + + + + + org.apache.maven.plugins + maven-site-plugin + + true + + + + + maven-assembly-plugin + + true + + + + maven-surefire-plugin + + + + secondPartTestsExecution + test + + test + + + true + + + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + [3.2,) + + compile + + + + + + + + + + + + + + + + + + org.apache.hbase + hbase-annotations + + + jdk.tools + jdk.tools + + + + + org.apache.hbase + hbase-annotations + test-jar + test + + + org.apache.hbase + hbase-client + + + org.apache.hbase + hbase-common + + + org.apache.hbase + hbase-common + test-jar + + + + commons-codec + commons-codec + + + commons-io + commons-io + + + commons-lang + commons-lang + + + commons-logging + commons-logging + + + com.google.protobuf + protobuf-java + + + org.apache.zookeeper + zookeeper + + + log4j + log4j + test + + + + + + + hadoop-2.0 + + + + !hadoop.profile + + + + + com.github.stephenc.findbugs + findbugs-annotations + true + + + org.apache.hadoop + hadoop-auth + + + org.apache.hadoop + hadoop-common + + + net.java.dev.jets3t + jets3t + + + javax.servlet.jsp + jsp-api + + + org.mortbay.jetty + jetty + + + com.sun.jersey + jersey-server + + + com.sun.jersey + jersey-core + + + com.sun.jersey + jersey-json + + + javax.servlet + servlet-api + + + tomcat + jasper-compiler + + + tomcat + jasper-runtime + + + com.google.code.findbugs + jsr305 + + + + + + + + + hadoop-3.0 + + + hadoop.profile + 3.0 + + + + 3.0-SNAPSHOT + + + + org.apache.hadoop + hadoop-auth + + + org.apache.hadoop + hadoop-common + + + + + diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationFactory.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationFactory.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationFactory.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationFactory.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationListener.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationListener.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationListener.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationListener.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfigListener.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfigListener.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfigListener.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfigListener.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerZKImpl.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerZKImpl.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerZKImpl.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerZKImpl.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeers.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeers.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeers.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeers.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueueInfo.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueueInfo.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueueInfo.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueueInfo.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesArguments.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesArguments.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesArguments.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesArguments.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClient.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClient.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClient.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClient.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientArguments.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientArguments.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientArguments.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientArguments.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientZKImpl.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientZKImpl.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientZKImpl.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesClientZKImpl.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesZKImpl.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesZKImpl.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesZKImpl.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesZKImpl.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateZKBase.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateZKBase.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateZKBase.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateZKBase.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTableBase.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTableBase.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTableBase.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTableBase.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTracker.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTracker.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTracker.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTracker.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTrackerZKImpl.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTrackerZKImpl.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTrackerZKImpl.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationTrackerZKImpl.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesClientImpl.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesClientImpl.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesClientImpl.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesClientImpl.java diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java similarity index 100% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java rename to hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml index 890ba2b680d..e1ef88234f0 100644 --- a/hbase-server/pom.xml +++ b/hbase-server/pom.xml @@ -376,6 +376,10 @@ org.apache.hbase hbase-client + + org.apache.hbase + hbase-replication + org.apache.hbase hbase-prefix-tree diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/BaseReplicationEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/BaseReplicationEndpoint.java index 0e619ea4d04..ae4e7ccb45b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/BaseReplicationEndpoint.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/BaseReplicationEndpoint.java @@ -27,8 +27,6 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.HBaseInterfaceAudience; import org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists; import org.apache.hadoop.hbase.shaded.com.google.common.util.concurrent.AbstractService; -import org.apache.hadoop.hbase.zookeeper.ZooKeeperListener; - /** * A Base implementation for {@link ReplicationEndpoint}s. Users should consider extending this * class rather than implementing {@link ReplicationEndpoint} directly for better backwards diff --git a/pom.xml b/pom.xml index 31ef24154c8..4d10324480a 100755 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,7 @@ hbase-build-support hbase-build-configuration + hbase-replication hbase-resource-bundle hbase-server hbase-thrift @@ -1603,6 +1604,11 @@ test-jar test + + hbase-replication + org.apache.hbase + ${project.version} + hbase-server org.apache.hbase