public class TThreadedSelectorServerWithFix
extends org.apache.thrift.server.AbstractNonblockingServer
Modifier and Type | Class and Description |
---|---|
protected class |
TThreadedSelectorServerWithFix.AcceptThread
The thread that selects on the server transport (listen socket) and accepts
new connections to hand off to the IO selector threads
|
static class |
TThreadedSelectorServerWithFix.Args |
protected class |
TThreadedSelectorServerWithFix.SelectorThread
The SelectorThread(s) will be doing all the selecting on accepted active
connections.
|
protected class |
TThreadedSelectorServerWithFix.SelectorThreadLoadBalancer
A round robin load balancer for choosing selector threads for new
connections.
|
org.apache.thrift.server.AbstractNonblockingServer.AbstractNonblockingServerArgs<T extends org.apache.thrift.server.AbstractNonblockingServer.AbstractNonblockingServerArgs<T>>, org.apache.thrift.server.AbstractNonblockingServer.AbstractSelectThread, org.apache.thrift.server.AbstractNonblockingServer.FrameBuffer
Constructor and Description |
---|
TThreadedSelectorServerWithFix(TThreadedSelectorServerWithFix.Args args)
Create the server with the specified Args configuration
|
Modifier and Type | Method and Description |
---|---|
protected static ExecutorService |
createDefaultExecutor(TThreadedSelectorServerWithFix.Args options)
Helper to create the invoker if one is not specified
|
protected TThreadedSelectorServerWithFix.SelectorThreadLoadBalancer |
createSelectorThreadLoadBalancer(Collection<? extends TThreadedSelectorServerWithFix.SelectorThread> threads)
Creates a SelectorThreadLoadBalancer to be used by the accept thread for
assigning newly accepted connections across the threads.
|
protected Runnable |
getRunnable(org.apache.thrift.server.AbstractNonblockingServer.FrameBuffer frameBuffer) |
protected void |
gracefullyShutdownInvokerPool() |
protected void |
joinThreads() |
protected boolean |
requestInvoke(org.apache.thrift.server.AbstractNonblockingServer.FrameBuffer frameBuffer)
We override the standard invoke method here to queue the invocation for
invoker service instead of immediately invoking.
|
protected boolean |
startThreads()
Start the accept and selector threads running to deal with clients.
|
void |
stop()
Stop serving and shut everything down.
|
protected void |
waitForShutdown()
Joins the accept and selector threads and shuts down the executor service.
|
public TThreadedSelectorServerWithFix(TThreadedSelectorServerWithFix.Args args)
protected boolean startThreads()
startThreads
in class org.apache.thrift.server.AbstractNonblockingServer
protected void waitForShutdown()
waitForShutdown
in class org.apache.thrift.server.AbstractNonblockingServer
protected void joinThreads() throws InterruptedException
InterruptedException
public void stop()
stop
in class org.apache.thrift.server.TServer
protected void gracefullyShutdownInvokerPool()
protected boolean requestInvoke(org.apache.thrift.server.AbstractNonblockingServer.FrameBuffer frameBuffer)
requestInvoke
in class org.apache.thrift.server.AbstractNonblockingServer
protected Runnable getRunnable(org.apache.thrift.server.AbstractNonblockingServer.FrameBuffer frameBuffer)
protected static ExecutorService createDefaultExecutor(TThreadedSelectorServerWithFix.Args options)
protected TThreadedSelectorServerWithFix.SelectorThreadLoadBalancer createSelectorThreadLoadBalancer(Collection<? extends TThreadedSelectorServerWithFix.SelectorThread> threads)
Copyright © 2016 The Apache Software Foundation. All rights reserved.