org.apache.blur.thrift.server
Class TThreadedSelectorServer

java.lang.Object
  extended by org.apache.blur.thirdparty.thrift_0_9_0.server.TServer
      extended by org.apache.blur.thrift.server.AbstractNonblockingServer
          extended by org.apache.blur.thrift.server.TThreadedSelectorServer

public class TThreadedSelectorServer
extends AbstractNonblockingServer

A Half-Sync/Half-Async server with a separate pool of threads to handle non-blocking I/O. Accepts are handled on a single thread, and a configurable number of nonblocking selector threads manage reading and writing of client connections. A synchronous worker thread pool handles processing of requests. Performs better than TNonblockingServer/THsHaServer in multi-core environments when the the bottleneck is CPU on the single selector thread handling I/O. In addition, because the accept handling is decoupled from reads/writes and invocation, the server has better ability to handle back- pressure from new connections (e.g. stop accepting when busy). Like TNonblockingServer, it relies on the use of TFramedTransport.


Nested Class Summary
static class TThreadedSelectorServer.Args
           
 
Nested classes/interfaces inherited from class org.apache.blur.thrift.server.AbstractNonblockingServer
AbstractNonblockingServer.AbstractNonblockingServerArgs<T extends AbstractNonblockingServer.AbstractNonblockingServerArgs<T>>
 
Nested classes/interfaces inherited from class org.apache.blur.thirdparty.thrift_0_9_0.server.TServer
TServer.AbstractServerArgs<T extends TServer.AbstractServerArgs<T>>
 
Constructor Summary
TThreadedSelectorServer(TThreadedSelectorServer.Args args)
          Create the server with the specified Args configuration
 
Method Summary
 void stop()
          Stop serving and shut everything down.
 
Methods inherited from class org.apache.blur.thrift.server.AbstractNonblockingServer
serve
 
Methods inherited from class org.apache.blur.thirdparty.thrift_0_9_0.server.TServer
getEventHandler, isServing, setServerEventHandler
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TThreadedSelectorServer

public TThreadedSelectorServer(TThreadedSelectorServer.Args args)
Create the server with the specified Args configuration

Method Detail

stop

public void stop()
Stop serving and shut everything down.

Overrides:
stop in class TServer


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.