You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2014/07/14 23:23:54 UTC

[3/3] git commit: Amend HBASE-11497 Expose RpcScheduling implementations as LimitedPrivate interfaces (Matteo Bertozzi)

Amend HBASE-11497 Expose RpcScheduling implementations as LimitedPrivate interfaces (Matteo Bertozzi)

Changes RpcScheduler from an interface into an abstract class


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

Branch: refs/heads/master
Commit: c61676a1ef5ad62974235a2b02723e6923d4bf98
Parents: e71d69b
Author: Andrew Purtell <ap...@apache.org>
Authored: Mon Jul 14 10:06:47 2014 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Mon Jul 14 14:19:52 2014 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/ipc/FifoRpcScheduler.java      |  2 +-
 .../apache/hadoop/hbase/ipc/RpcScheduler.java   | 22 ++++++++++----------
 .../hadoop/hbase/ipc/RpcSchedulerContext.java   |  2 +-
 .../hadoop/hbase/ipc/SimpleRpcScheduler.java    |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c61676a1/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoRpcScheduler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoRpcScheduler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoRpcScheduler.java
index 7618436..648ca1f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoRpcScheduler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/FifoRpcScheduler.java
@@ -31,7 +31,7 @@ import org.apache.hadoop.hbase.ipc.CallRunner;
  *
  * This can be used for HMaster, where no prioritization is needed.
  */
-public class FifoRpcScheduler implements RpcScheduler {
+public class FifoRpcScheduler extends RpcScheduler {
 
   private final int handlerCount;
   private final int maxQueueLength;

http://git-wip-us.apache.org/repos/asf/hbase/blob/c61676a1/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcScheduler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcScheduler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcScheduler.java
index f3427df..33043aa 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcScheduler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcScheduler.java
@@ -29,11 +29,11 @@ import java.net.InetSocketAddress;
  */
 @InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})
 @InterfaceStability.Evolving
-public interface RpcScheduler {
+public abstract class RpcScheduler {
 
   /** Exposes runtime information of a {@code RpcServer} that a {@code RpcScheduler} may need. */
-  interface Context {
-    InetSocketAddress getListenerAddress();
+  static abstract class Context {
+    public abstract InetSocketAddress getListenerAddress();
   }
 
   /**
@@ -42,15 +42,15 @@ public interface RpcScheduler {
    *
    * @param context provides methods to retrieve runtime information from
    */
-  void init(Context context);
+  public abstract void init(Context context);
 
   /**
    * Prepares for request serving. An implementation may start some handler threads here.
    */
-  void start();
+  public abstract void start();
 
   /** Stops serving new requests. */
-  void stop();
+  public abstract void stop();
 
   /**
    * Dispatches an RPC request asynchronously. An implementation is free to choose to process the
@@ -58,17 +58,17 @@ public interface RpcScheduler {
    *
    * @param task the request to be dispatched
    */
-  void dispatch(CallRunner task) throws IOException, InterruptedException;
+  public abstract void dispatch(CallRunner task) throws IOException, InterruptedException;
 
   /** Retrieves length of the general queue for metrics. */
-  int getGeneralQueueLength();
+  public abstract int getGeneralQueueLength();
 
   /** Retrieves length of the priority queue for metrics. */
-  int getPriorityQueueLength();
+  public abstract int getPriorityQueueLength();
 
   /** Retrieves length of the replication queue for metrics. */
-  int getReplicationQueueLength();
+  public abstract int getReplicationQueueLength();
 
   /** Retrieves the number of active handler. */
-  int getActiveRpcHandlerCount();
+  public abstract int getActiveRpcHandlerCount();
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/c61676a1/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcSchedulerContext.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcSchedulerContext.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcSchedulerContext.java
index c079929..1b499e9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcSchedulerContext.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcSchedulerContext.java
@@ -22,7 +22,7 @@ import java.net.InetSocketAddress;
 import org.apache.hadoop.classification.InterfaceAudience;
 
 @InterfaceAudience.Private
-class RpcSchedulerContext implements RpcScheduler.Context {
+class RpcSchedulerContext extends RpcScheduler.Context {
   private final RpcServer rpcServer;
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/c61676a1/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java
index 892688d..4b46595 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java
@@ -35,7 +35,7 @@ import org.apache.hadoop.hbase.util.BoundedPriorityBlockingQueue;
  */
 @InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})
 @InterfaceStability.Evolving
-public class SimpleRpcScheduler implements RpcScheduler {
+public class SimpleRpcScheduler extends RpcScheduler {
   public static final Log LOG = LogFactory.getLog(SimpleRpcScheduler.class);
 
   public static final String CALL_QUEUE_READ_SHARE_CONF_KEY = "ipc.server.callqueue.read.share";