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

Changes RpcScheduler from an interface into an abstract class
This commit is contained in:
Andrew Purtell 2014-07-14 10:06:47 -07:00
parent e71d69bf00
commit c61676a1ef
4 changed files with 14 additions and 14 deletions

View File

@ -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;

View File

@ -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();
}

View File

@ -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;
/**

View File

@ -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";