org.apache.accumulo.server.util
Class TServerUtils

java.lang.Object
  extended by org.apache.accumulo.server.util.TServerUtils

public class TServerUtils
extends Object


Nested Class Summary
static class TServerUtils.ClientInfoProcessorFactory
           
static class TServerUtils.ServerPort
           
static class TServerUtils.THsHaServer
           
static class TServerUtils.TimedProcessor
           
 
Field Summary
static ThreadLocal<String> clientAddress
           
 
Constructor Summary
TServerUtils()
           
 
Method Summary
static TServerUtils.ServerPort startHsHaServer(int port, org.apache.thrift.TProcessor processor, String serverName, String threadName, int numThreads, long timeBetweenThreadChecks)
           
static TServerUtils.ServerPort startServer(Property portHintProperty, org.apache.thrift.TProcessor processor, String serverName, String threadName, Property portSearchProperty, Property minThreadProperty, Property timeBetweenThreadChecksProperty)
          Start a server, at the given port, or higher, if that port is not available.
static TServerUtils.ServerPort startThreadPoolServer(int port, org.apache.thrift.TProcessor processor, String serverName, String threadName, int numThreads)
           
static TServerUtils.ServerPort startTServer(int port, org.apache.thrift.TProcessor processor, String serverName, String threadName, int numThreads, long timeBetweenThreadChecks)
           
static void stopTServer(org.apache.thrift.server.TServer s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clientAddress

public static ThreadLocal<String> clientAddress
Constructor Detail

TServerUtils

public TServerUtils()
Method Detail

startServer

public static TServerUtils.ServerPort startServer(Property portHintProperty,
                                                  org.apache.thrift.TProcessor processor,
                                                  String serverName,
                                                  String threadName,
                                                  Property portSearchProperty,
                                                  Property minThreadProperty,
                                                  Property timeBetweenThreadChecksProperty)
                                           throws UnknownHostException
Start a server, at the given port, or higher, if that port is not available.

Parameters:
portHintProperty - the port to attempt to open, can be zero, meaning "any available port"
processor - the service to be started
serverName - the name of the class that is providing the service
threadName - name this service's thread for better debugging
portSearchProperty -
minThreadProperty -
timeBetweenThreadChecksProperty -
Returns:
the server object created, and the port actually used
Throws:
UnknownHostException - when we don't know our own address

startHsHaServer

public static TServerUtils.ServerPort startHsHaServer(int port,
                                                      org.apache.thrift.TProcessor processor,
                                                      String serverName,
                                                      String threadName,
                                                      int numThreads,
                                                      long timeBetweenThreadChecks)
                                               throws org.apache.thrift.transport.TTransportException
Throws:
org.apache.thrift.transport.TTransportException

startThreadPoolServer

public static TServerUtils.ServerPort startThreadPoolServer(int port,
                                                            org.apache.thrift.TProcessor processor,
                                                            String serverName,
                                                            String threadName,
                                                            int numThreads)
                                                     throws org.apache.thrift.transport.TTransportException
Throws:
org.apache.thrift.transport.TTransportException

startTServer

public static TServerUtils.ServerPort startTServer(int port,
                                                   org.apache.thrift.TProcessor processor,
                                                   String serverName,
                                                   String threadName,
                                                   int numThreads,
                                                   long timeBetweenThreadChecks)
                                            throws org.apache.thrift.transport.TTransportException
Throws:
org.apache.thrift.transport.TTransportException

stopTServer

public static void stopTServer(org.apache.thrift.server.TServer s)


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