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 7618436d1a5..648ca1f9660 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; 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 f3427df11f4..33043aa632b 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(); } 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 c0799297073..1b499e9a205 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; /** 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 892688d17c2..4b46595143d 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";