org.apache.hadoop.hbase.ipc
Class RpcScheduler

java.lang.Object
  extended by org.apache.hadoop.hbase.ipc.RpcScheduler
Direct Known Subclasses:
FifoRpcScheduler, SimpleRpcScheduler

@InterfaceAudience.LimitedPrivate(value={"Coprocesssor","Phoenix"})
@InterfaceStability.Evolving
public abstract class RpcScheduler
extends Object

An interface for RPC request scheduling algorithm.


Constructor Summary
RpcScheduler()
           
 
Method Summary
abstract  void dispatch(CallRunner task)
          Dispatches an RPC request asynchronously.
abstract  int getActiveRpcHandlerCount()
          Retrieves the number of active handler.
abstract  int getGeneralQueueLength()
          Retrieves length of the general queue for metrics.
abstract  int getPriorityQueueLength()
          Retrieves length of the priority queue for metrics.
abstract  int getReplicationQueueLength()
          Retrieves length of the replication queue for metrics.
abstract  void init(org.apache.hadoop.hbase.ipc.RpcScheduler.Context context)
          Does some quick initialization.
abstract  void start()
          Prepares for request serving.
abstract  void stop()
          Stops serving new requests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RpcScheduler

public RpcScheduler()
Method Detail

init

public abstract void init(org.apache.hadoop.hbase.ipc.RpcScheduler.Context context)
Does some quick initialization. Heavy tasks (e.g. starting threads) should be done in start(). This method is called before start.

Parameters:
context - provides methods to retrieve runtime information from

start

public abstract void start()
Prepares for request serving. An implementation may start some handler threads here.


stop

public abstract void stop()
Stops serving new requests.


dispatch

public abstract void dispatch(CallRunner task)
                       throws IOException,
                              InterruptedException
Dispatches an RPC request asynchronously. An implementation is free to choose to process the request immediately or delay it for later processing.

Parameters:
task - the request to be dispatched
Throws:
IOException
InterruptedException

getGeneralQueueLength

public abstract int getGeneralQueueLength()
Retrieves length of the general queue for metrics.


getPriorityQueueLength

public abstract int getPriorityQueueLength()
Retrieves length of the priority queue for metrics.


getReplicationQueueLength

public abstract int getReplicationQueueLength()
Retrieves length of the replication queue for metrics.


getActiveRpcHandlerCount

public abstract int getActiveRpcHandlerCount()
Retrieves the number of active handler.



Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.