org.apache.hadoop.hbase.ipc
Class SimpleRpcScheduler

java.lang.Object
  extended by org.apache.hadoop.hbase.ipc.RpcScheduler
      extended by org.apache.hadoop.hbase.ipc.SimpleRpcScheduler

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

A scheduler that maintains isolated handler pools for general, high-priority and replication requests.


Field Summary
static String CALL_QUEUE_HANDLER_FACTOR_CONF_KEY
           
static String CALL_QUEUE_MAX_LENGTH_CONF_KEY
           
static String CALL_QUEUE_READ_SHARE_CONF_KEY
           
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
SimpleRpcScheduler(org.apache.hadoop.conf.Configuration conf, int handlerCount, int priorityHandlerCount, int replicationHandlerCount, PriorityFunction priority, Abortable abortable, int highPriorityLevel)
           
 
Method Summary
 void dispatch(CallRunner callTask)
          Dispatches an RPC request asynchronously.
 int getActiveRpcHandlerCount()
          Retrieves the number of active handler.
 int getGeneralQueueLength()
          Retrieves length of the general queue for metrics.
 int getPriorityQueueLength()
          Retrieves length of the priority queue for metrics.
 int getReplicationQueueLength()
          Retrieves length of the replication queue for metrics.
 void init(org.apache.hadoop.hbase.ipc.RpcScheduler.Context context)
          Does some quick initialization.
 void start()
          Prepares for request serving.
 void stop()
          Stops serving new requests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG

CALL_QUEUE_READ_SHARE_CONF_KEY

public static final String CALL_QUEUE_READ_SHARE_CONF_KEY
See Also:
Constant Field Values

CALL_QUEUE_HANDLER_FACTOR_CONF_KEY

public static final String CALL_QUEUE_HANDLER_FACTOR_CONF_KEY
See Also:
Constant Field Values

CALL_QUEUE_MAX_LENGTH_CONF_KEY

public static final String CALL_QUEUE_MAX_LENGTH_CONF_KEY
See Also:
Constant Field Values
Constructor Detail

SimpleRpcScheduler

public SimpleRpcScheduler(org.apache.hadoop.conf.Configuration conf,
                          int handlerCount,
                          int priorityHandlerCount,
                          int replicationHandlerCount,
                          PriorityFunction priority,
                          Abortable abortable,
                          int highPriorityLevel)
Parameters:
conf -
handlerCount - the number of handler threads that will be used to process calls
priorityHandlerCount - How many threads for priority handling.
replicationHandlerCount - How many threads for replication handling.
highPriorityLevel -
priority - Function to extract request priority.
Method Detail

init

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

Specified by:
init in class RpcScheduler
Parameters:
context - provides methods to retrieve runtime information from

start

public void start()
Description copied from class: RpcScheduler
Prepares for request serving. An implementation may start some handler threads here.

Specified by:
start in class RpcScheduler

stop

public void stop()
Description copied from class: RpcScheduler
Stops serving new requests.

Specified by:
stop in class RpcScheduler

dispatch

public void dispatch(CallRunner callTask)
              throws InterruptedException
Description copied from class: RpcScheduler
Dispatches an RPC request asynchronously. An implementation is free to choose to process the request immediately or delay it for later processing.

Specified by:
dispatch in class RpcScheduler
Parameters:
callTask - the request to be dispatched
Throws:
InterruptedException

getGeneralQueueLength

public int getGeneralQueueLength()
Description copied from class: RpcScheduler
Retrieves length of the general queue for metrics.

Specified by:
getGeneralQueueLength in class RpcScheduler

getPriorityQueueLength

public int getPriorityQueueLength()
Description copied from class: RpcScheduler
Retrieves length of the priority queue for metrics.

Specified by:
getPriorityQueueLength in class RpcScheduler

getReplicationQueueLength

public int getReplicationQueueLength()
Description copied from class: RpcScheduler
Retrieves length of the replication queue for metrics.

Specified by:
getReplicationQueueLength in class RpcScheduler

getActiveRpcHandlerCount

public int getActiveRpcHandlerCount()
Description copied from class: RpcScheduler
Retrieves the number of active handler.

Specified by:
getActiveRpcHandlerCount in class RpcScheduler


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