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
f0035e6837
commit
044d62ac25
|
@ -31,7 +31,7 @@ import org.apache.hadoop.hbase.ipc.CallRunner;
|
||||||
*
|
*
|
||||||
* This can be used for HMaster, where no prioritization is needed.
|
* 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 handlerCount;
|
||||||
private final int maxQueueLength;
|
private final int maxQueueLength;
|
||||||
|
|
|
@ -29,11 +29,11 @@ import java.net.InetSocketAddress;
|
||||||
*/
|
*/
|
||||||
@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})
|
@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})
|
||||||
@InterfaceStability.Evolving
|
@InterfaceStability.Evolving
|
||||||
public interface RpcScheduler {
|
public abstract class RpcScheduler {
|
||||||
|
|
||||||
/** Exposes runtime information of a {@code RpcServer} that a {@code RpcScheduler} may need. */
|
/** Exposes runtime information of a {@code RpcServer} that a {@code RpcScheduler} may need. */
|
||||||
interface Context {
|
static abstract class Context {
|
||||||
InetSocketAddress getListenerAddress();
|
public abstract InetSocketAddress getListenerAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,15 +42,15 @@ public interface RpcScheduler {
|
||||||
*
|
*
|
||||||
* @param context provides methods to retrieve runtime information from
|
* @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.
|
* Prepares for request serving. An implementation may start some handler threads here.
|
||||||
*/
|
*/
|
||||||
void start();
|
public abstract void start();
|
||||||
|
|
||||||
/** Stops serving new requests. */
|
/** Stops serving new requests. */
|
||||||
void stop();
|
public abstract void stop();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dispatches an RPC request asynchronously. An implementation is free to choose to process the
|
* 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
|
* @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. */
|
/** Retrieves length of the general queue for metrics. */
|
||||||
int getGeneralQueueLength();
|
public abstract int getGeneralQueueLength();
|
||||||
|
|
||||||
/** Retrieves length of the priority queue for metrics. */
|
/** Retrieves length of the priority queue for metrics. */
|
||||||
int getPriorityQueueLength();
|
public abstract int getPriorityQueueLength();
|
||||||
|
|
||||||
/** Retrieves length of the replication queue for metrics. */
|
/** Retrieves length of the replication queue for metrics. */
|
||||||
int getReplicationQueueLength();
|
public abstract int getReplicationQueueLength();
|
||||||
|
|
||||||
/** Retrieves the number of active handler. */
|
/** 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;
|
import org.apache.hadoop.classification.InterfaceAudience;
|
||||||
|
|
||||||
@InterfaceAudience.Private
|
@InterfaceAudience.Private
|
||||||
class RpcSchedulerContext implements RpcScheduler.Context {
|
class RpcSchedulerContext extends RpcScheduler.Context {
|
||||||
private final RpcServer rpcServer;
|
private final RpcServer rpcServer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,7 +35,7 @@ import org.apache.hadoop.hbase.util.BoundedPriorityBlockingQueue;
|
||||||
*/
|
*/
|
||||||
@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})
|
@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})
|
||||||
@InterfaceStability.Evolving
|
@InterfaceStability.Evolving
|
||||||
public class SimpleRpcScheduler implements RpcScheduler {
|
public class SimpleRpcScheduler extends RpcScheduler {
|
||||||
public static final Log LOG = LogFactory.getLog(SimpleRpcScheduler.class);
|
public static final Log LOG = LogFactory.getLog(SimpleRpcScheduler.class);
|
||||||
|
|
||||||
public static final String CALL_QUEUE_READ_SHARE_CONF_KEY = "ipc.server.callqueue.read.share";
|
public static final String CALL_QUEUE_READ_SHARE_CONF_KEY = "ipc.server.callqueue.read.share";
|
||||||
|
|
Loading…
Reference in New Issue