org.apache.hadoop.hbase.thrift
Class TBoundedThreadPoolServer

java.lang.Object
  extended by org.apache.thrift.server.TServer
      extended by org.apache.hadoop.hbase.thrift.TBoundedThreadPoolServer

@InterfaceAudience.Private
public class TBoundedThreadPoolServer
extends org.apache.thrift.server.TServer

A bounded thread pool server customized for HBase.


Nested Class Summary
static class TBoundedThreadPoolServer.Args
           
 
Nested classes/interfaces inherited from class org.apache.thrift.server.TServer
org.apache.thrift.server.TServer.AbstractServerArgs<T extends org.apache.thrift.server.TServer.AbstractServerArgs<T>>
 
Field Summary
static int DEFAULT_MAX_QUEUED_REQUESTS
           
static int DEFAULT_MAX_WORKER_THREADS
           
static int DEFAULT_MIN_WORKER_THREADS
          This default core pool size should be enough for many test scenarios.
static String MAX_QUEUED_REQUESTS_CONF_KEY
          The maximum number of pending connections waiting in the queue.
static String MAX_WORKER_THREADS_CONF_KEY
          The maximum size of the thread pool.
static String MIN_WORKER_THREADS_CONF_KEY
          The "core size" of the thread pool.
static String THREAD_KEEP_ALIVE_TIME_SEC_CONF_KEY
          Default amount of time in seconds to keep a thread alive.
static int TIME_TO_WAIT_AFTER_SHUTDOWN_MS
          Time to wait after interrupting all worker threads.
 
Fields inherited from class org.apache.thrift.server.TServer
eventHandler_, inputProtocolFactory_, inputTransportFactory_, outputProtocolFactory_, outputTransportFactory_, processorFactory_, serverTransport_
 
Constructor Summary
TBoundedThreadPoolServer(TBoundedThreadPoolServer.Args options, ThriftMetrics metrics)
           
 
Method Summary
 void serve()
           
 void stop()
           
 
Methods inherited from class org.apache.thrift.server.TServer
getEventHandler, isServing, setServerEventHandler, setServing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_WORKER_THREADS_CONF_KEY

public static final String MIN_WORKER_THREADS_CONF_KEY
The "core size" of the thread pool. New threads are created on every connection until this many threads are created.

See Also:
Constant Field Values

DEFAULT_MIN_WORKER_THREADS

public static final int DEFAULT_MIN_WORKER_THREADS
This default core pool size should be enough for many test scenarios. We want to override this with a much larger number (e.g. at least 200) for a large-scale production setup.

See Also:
Constant Field Values

MAX_WORKER_THREADS_CONF_KEY

public static final String MAX_WORKER_THREADS_CONF_KEY
The maximum size of the thread pool. When the pending request queue overflows, new threads are created until their number reaches this number. After that, the server starts dropping connections.

See Also:
Constant Field Values

DEFAULT_MAX_WORKER_THREADS

public static final int DEFAULT_MAX_WORKER_THREADS
See Also:
Constant Field Values

MAX_QUEUED_REQUESTS_CONF_KEY

public static final String MAX_QUEUED_REQUESTS_CONF_KEY
The maximum number of pending connections waiting in the queue. If there are no idle threads in the pool, the server queues requests. Only when the queue overflows, new threads are added, up to hbase.thrift.maxQueuedRequests threads.

See Also:
Constant Field Values

DEFAULT_MAX_QUEUED_REQUESTS

public static final int DEFAULT_MAX_QUEUED_REQUESTS
See Also:
Constant Field Values

THREAD_KEEP_ALIVE_TIME_SEC_CONF_KEY

public static final String THREAD_KEEP_ALIVE_TIME_SEC_CONF_KEY
Default amount of time in seconds to keep a thread alive. Worker threads are stopped after being idle for this long.

See Also:
Constant Field Values

TIME_TO_WAIT_AFTER_SHUTDOWN_MS

public static final int TIME_TO_WAIT_AFTER_SHUTDOWN_MS
Time to wait after interrupting all worker threads. This is after a clean shutdown has been attempted.

See Also:
Constant Field Values
Constructor Detail

TBoundedThreadPoolServer

public TBoundedThreadPoolServer(TBoundedThreadPoolServer.Args options,
                                ThriftMetrics metrics)
Method Detail

serve

public void serve()
Specified by:
serve in class org.apache.thrift.server.TServer

stop

public void stop()
Overrides:
stop in class org.apache.thrift.server.TServer


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.