org.apache.thrift.server
Class THsHaServer

java.lang.Object
  extended by org.apache.thrift.server.TServer
      extended by org.apache.thrift.server.TNonblockingServer
          extended by org.apache.thrift.server.THsHaServer

public class THsHaServer
extends TNonblockingServer

An extension of the TNonblockingServer to a Half-Sync/Half-Async server. Like TNonblockingServer, it relies on the use of TFramedTransport.


Nested Class Summary
static class THsHaServer.Args
           
 
Nested classes/interfaces inherited from class org.apache.thrift.server.TNonblockingServer
TNonblockingServer.AbstractNonblockingServerArgs<T extends TNonblockingServer.AbstractNonblockingServerArgs<T>>, TNonblockingServer.FrameBuffer, TNonblockingServer.SelectThread
 
Nested classes/interfaces inherited from class org.apache.thrift.server.TServer
TServer.AbstractServerArgs<T extends TServer.AbstractServerArgs<T>>
 
Field Summary
 
Fields inherited from class org.apache.thrift.server.TServer
inputProtocolFactory_, inputTransportFactory_, outputProtocolFactory_, outputTransportFactory_, processorFactory_, serverTransport_
 
Constructor Summary
THsHaServer(THsHaServer.Args args)
          Create server with every option fully specified, and with an injected ExecutorService
 
Method Summary
protected static java.util.concurrent.ExecutorService createInvokerPool(THsHaServer.Args options)
          Helper to create an invoker pool
protected  java.lang.Runnable getRunnable(TNonblockingServer.FrameBuffer frameBuffer)
           
protected  void gracefullyShutdownInvokerPool()
           
protected  boolean requestInvoke(TNonblockingServer.FrameBuffer frameBuffer)
          We override the standard invoke method here to queue the invocation for invoker service instead of immediately invoking.
 void serve()
          Begin accepting connections and processing invocations.
 
Methods inherited from class org.apache.thrift.server.TNonblockingServer
isStopped, joinSelector, requestSelectInterestChange, startListening, startSelectorThread, stop, stopListening
 
Methods inherited from class org.apache.thrift.server.TServer
isServing, setServing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

THsHaServer

public THsHaServer(THsHaServer.Args args)
Create server with every option fully specified, and with an injected ExecutorService

Method Detail

serve

public void serve()
Description copied from class: TNonblockingServer
Begin accepting connections and processing invocations.

Overrides:
serve in class TNonblockingServer

createInvokerPool

protected static java.util.concurrent.ExecutorService createInvokerPool(THsHaServer.Args options)
Helper to create an invoker pool


gracefullyShutdownInvokerPool

protected void gracefullyShutdownInvokerPool()

requestInvoke

protected boolean requestInvoke(TNonblockingServer.FrameBuffer frameBuffer)
We override the standard invoke method here to queue the invocation for invoker service instead of immediately invoking. The thread pool takes care of the rest.

Overrides:
requestInvoke in class TNonblockingServer

getRunnable

protected java.lang.Runnable getRunnable(TNonblockingServer.FrameBuffer frameBuffer)