org.apache.accumulo.server.util
Class TServerUtils

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

public class TServerUtils
extends java.lang.Object


Nested Class Summary
static class TServerUtils.ClientInfoProcessorFactory
           
static class TServerUtils.ServerPort
           
static class TServerUtils.TimedProcessor
           
 
Field Summary
static java.lang.ThreadLocal<java.lang.String> clientAddress
           
 
Constructor Summary
TServerUtils()
           
 
Method Summary
static org.apache.thrift.transport.TServerTransport openPort(int port)
           
static TServerUtils.ServerPort startServer(Property portHintProperty, org.apache.thrift.TProcessor processor, java.lang.String serverName, java.lang.String threadName, boolean portSearch)
          Start a server, at the given port, or higher, if that port is not available.
static org.apache.thrift.server.TServer startTServer(org.apache.thrift.TProcessor processor, org.apache.thrift.transport.TServerTransport serverTransport, java.lang.String serverName, java.lang.String threadName, int numThreads)
           
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 java.lang.ThreadLocal<java.lang.String> clientAddress
Constructor Detail

TServerUtils

public TServerUtils()
Method Detail

openPort

public static org.apache.thrift.transport.TServerTransport openPort(int port)
                                                             throws java.io.IOException
Throws:
java.io.IOException

startServer

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

Parameters:
portHint - 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
Returns:
the server object created, and the port actually used
Throws:
java.net.UnknownHostException - when we don't know our own address

startTServer

public static org.apache.thrift.server.TServer startTServer(org.apache.thrift.TProcessor processor,
                                                            org.apache.thrift.transport.TServerTransport serverTransport,
                                                            java.lang.String serverName,
                                                            java.lang.String threadName,
                                                            int numThreads)

stopTServer

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


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