hbase git commit: HBASE-15982 Interface ReplicationEndpoint extends Guava's Service

2017-08-24 Thread stack
Repository: hbase
Updated Branches:
  refs/heads/branch-2 1ae9a3901 -> ec7bca176


HBASE-15982 Interface ReplicationEndpoint extends Guava's Service

Breaking change to our ReplicationEndpoint and BaseReplicationEndpoint.

ReplicationEndpoint implemented Guava 0.12 Service. An abstract
subclass, BaseReplicationEndpoint, provided default implementations
and facility, among other things, by extending Guava
AbstractService class.

Both of these HBase classes were marked LimitedPrivate for
REPLICATION so these classes were semi-public and made it so
Guava 0.12 was part of our API.

Having Guava in our API was a mistake. It anchors us and the
implementation of the Interface to Guava 0.12. This is untenable
given Guava changes and that the Service Interface in particular
has had extensive revamp and improvement done. We can't hold to
the Guava Interface. It changed. We can't stay on Guava 0.12;
implementors and others on our CLASSPATH won't abide being stuck
on an old Guava.

So this class makes breaking changes. The unhitching of our Interface
from Guava could only be done in a breaking manner. It undoes the
LimitedPrivate on BaseReplicationEndpoint while keeping it for the RE
Interface. It means consumers will have to copy/paste the
AbstractService-based BRE into their own codebase also supplying their
own Guava; HBase no longer 'supplies' this (our Guava usage has
been internalized, relocated).

This patch then adds into RE the basic methods RE needs of the old
Guava Service rather than return a Service to start/stop only to go
back to the RE instance to do actual work. A few method names had to
be changed so could make implementations with Guava Service internally
and not have RE method names and types clash). Semantics remained the
same otherwise. For example startAsync and stopAsync in Guava are start
and stop in RE.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/ec7bca17
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ec7bca17
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ec7bca17

Branch: refs/heads/branch-2
Commit: ec7bca1769dcd825289e485c331e716df8ee33a1
Parents: 1ae9a39
Author: Michael Stack 
Authored: Tue Aug 8 21:55:47 2017 +0800
Committer: Michael Stack 
Committed: Thu Aug 24 08:06:09 2017 -0700

--
 .../replication/BaseReplicationEndpoint.java| 16 ++--
 .../replication/HBaseReplicationEndpoint.java   | 10 +++
 .../hbase/replication/ReplicationEndpoint.java  | 88 +++-
 .../regionserver/ReplicationSource.java | 38 -
 .../VisibilityReplicationEndpoint.java  | 40 -
 .../TestReplicationAdminWithClusters.java   | 10 +++
 .../replication/TestReplicationEndpoint.java| 10 +++
 .../replication/TestReplicationSource.java  |  2 +-
 8 files changed, 160 insertions(+), 54 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/ec7bca17/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/BaseReplicationEndpoint.java
--
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 ae4e7cc..5b9cef7 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
@@ -24,15 +24,16 @@ import java.util.ArrayList;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 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;
+
 /**
- * A Base implementation for {@link ReplicationEndpoint}s. Users should 
consider extending this
- * class rather than implementing {@link ReplicationEndpoint} directly for 
better backwards
- * compatibility.
+ * A Base implementation for {@link ReplicationEndpoint}s. For internal use. 
Uses our internal
+ * Guava.
  */
-@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.REPLICATION)
+// This class has been made InterfaceAudience.Private in 2.0.0. It used to be
+// LimitedPrivate. See HBASE-15982.
+@InterfaceAudience.Private
 public abstract class BaseReplicationEndpoint extends AbstractService
   implements ReplicationEndpoint {
 
@@ -109,4 +110,9 @@ public abstract class BaseReplicationEndpoint extends 
AbstractService
   public boolean canReplicateToSameCluster() {
 return false;
   }
+
+  @Override
+  public boolean isStarting() 

hbase git commit: HBASE-15982 Interface ReplicationEndpoint extends Guava's Service

2017-08-24 Thread stack
Repository: hbase
Updated Branches:
  refs/heads/master d12eb7a4a -> 6e7baa07f


HBASE-15982 Interface ReplicationEndpoint extends Guava's Service

Breaking change to our ReplicationEndpoint and BaseReplicationEndpoint.

ReplicationEndpoint implemented Guava 0.12 Service. An abstract
subclass, BaseReplicationEndpoint, provided default implementations
and facility, among other things, by extending Guava
AbstractService class.

Both of these HBase classes were marked LimitedPrivate for
REPLICATION so these classes were semi-public and made it so
Guava 0.12 was part of our API.

Having Guava in our API was a mistake. It anchors us and the
implementation of the Interface to Guava 0.12. This is untenable
given Guava changes and that the Service Interface in particular
has had extensive revamp and improvement done. We can't hold to
the Guava Interface. It changed. We can't stay on Guava 0.12;
implementors and others on our CLASSPATH won't abide being stuck
on an old Guava.

So this class makes breaking changes. The unhitching of our Interface
from Guava could only be done in a breaking manner. It undoes the
LimitedPrivate on BaseReplicationEndpoint while keeping it for the RE
Interface. It means consumers will have to copy/paste the
AbstractService-based BRE into their own codebase also supplying their
own Guava; HBase no longer 'supplies' this (our Guava usage has
been internalized, relocated).

This patch then adds into RE the basic methods RE needs of the old
Guava Service rather than return a Service to start/stop only to go
back to the RE instance to do actual work. A few method names had to
be changed so could make implementations with Guava Service internally
and not have RE method names and types clash). Semantics remained the
same otherwise. For example startAsync and stopAsync in Guava are start
and stop in RE.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6e7baa07
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6e7baa07
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6e7baa07

Branch: refs/heads/master
Commit: 6e7baa07f0b1f5841379545acaf23d36f50de2c2
Parents: d12eb7a
Author: Michael Stack 
Authored: Tue Aug 8 21:55:47 2017 +0800
Committer: Michael Stack 
Committed: Thu Aug 24 08:05:27 2017 -0700

--
 .../replication/BaseReplicationEndpoint.java| 16 ++--
 .../replication/HBaseReplicationEndpoint.java   | 10 +++
 .../hbase/replication/ReplicationEndpoint.java  | 88 +++-
 .../regionserver/ReplicationSource.java | 38 -
 .../VisibilityReplicationEndpoint.java  | 40 -
 .../TestReplicationAdminWithClusters.java   | 10 +++
 .../replication/TestReplicationEndpoint.java| 10 +++
 .../replication/TestReplicationSource.java  |  2 +-
 8 files changed, 160 insertions(+), 54 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/6e7baa07/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/BaseReplicationEndpoint.java
--
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 ae4e7cc..5b9cef7 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
@@ -24,15 +24,16 @@ import java.util.ArrayList;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 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;
+
 /**
- * A Base implementation for {@link ReplicationEndpoint}s. Users should 
consider extending this
- * class rather than implementing {@link ReplicationEndpoint} directly for 
better backwards
- * compatibility.
+ * A Base implementation for {@link ReplicationEndpoint}s. For internal use. 
Uses our internal
+ * Guava.
  */
-@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.REPLICATION)
+// This class has been made InterfaceAudience.Private in 2.0.0. It used to be
+// LimitedPrivate. See HBASE-15982.
+@InterfaceAudience.Private
 public abstract class BaseReplicationEndpoint extends AbstractService
   implements ReplicationEndpoint {
 
@@ -109,4 +110,9 @@ public abstract class BaseReplicationEndpoint extends 
AbstractService
   public boolean canReplicateToSameCluster() {
 return false;
   }
+
+  @Override
+  public boolean isStarting() {
+