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:
parent
e71d69bf00
commit
c61676a1ef
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Reference in New Issue