Package org.apache.thrift.server
Class THsHaServer
java.lang.Object
org.apache.thrift.server.TServer
org.apache.thrift.server.AbstractNonblockingServer
org.apache.thrift.server.TNonblockingServer
org.apache.thrift.server.THsHaServer
An extension of the TNonblockingServer to a Half-Sync/Half-Async server. Like TNonblockingServer,
it relies on the use of TFramedTransport.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.thrift.server.TNonblockingServer
TNonblockingServer.SelectAcceptThreadNested classes/interfaces inherited from class org.apache.thrift.server.AbstractNonblockingServer
AbstractNonblockingServer.AbstractNonblockingServerArgs<T extends AbstractNonblockingServer.AbstractNonblockingServerArgs<T>>, AbstractNonblockingServer.AbstractSelectThread, AbstractNonblockingServer.AsyncFrameBuffer, AbstractNonblockingServer.FrameBufferNested 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.AbstractNonblockingServer
LOGGERFields inherited from class org.apache.thrift.server.TServer
eventHandler_, inputProtocolFactory_, inputTransportFactory_, outputProtocolFactory_, outputTransportFactory_, processorFactory_, serverTransport_, stopped_ -
Constructor Summary
ConstructorsConstructorDescriptionTHsHaServer(THsHaServer.Args args) Create the server with the specified Args configuration -
Method Summary
Modifier and TypeMethodDescriptionprotected static ExecutorServicecreateInvokerPool(THsHaServer.Args options) Helper to create an invoker poolprotected ExecutorServiceprotected RunnablegetRunnable(AbstractNonblockingServer.FrameBuffer frameBuffer) protected voidprotected booleanrequestInvoke(AbstractNonblockingServer.FrameBuffer frameBuffer) We override the standard invoke method here to queue the invocation for invoker service instead of immediately invoking.protected voidA method that will block until when threads handling the serving have been shut down.Methods inherited from class org.apache.thrift.server.TNonblockingServer
isStopped, joinSelector, startThreads, stopMethods inherited from class org.apache.thrift.server.AbstractNonblockingServer
serve, startListening, stopListeningMethods inherited from class org.apache.thrift.server.TServer
getEventHandler, getShouldStop, isServing, setServerEventHandler, setServing, setShouldStop
-
Constructor Details
-
THsHaServer
Create the server with the specified Args configuration
-
-
Method Details
-
waitForShutdown
protected void waitForShutdown()A method that will block until when threads handling the serving have been shut down.- Overrides:
waitForShutdownin classTNonblockingServer
-
createInvokerPool
Helper to create an invoker pool -
getInvoker
-
gracefullyShutdownInvokerPool
protected void gracefullyShutdownInvokerPool() -
requestInvoke
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:
requestInvokein classTNonblockingServer- Returns:
- true if invocation was successfully requested, which is not a guarantee that invocation has completed. False if the request failed.
-
getRunnable
-