Package org.apache.accumulo.server.rpc
Class TServerUtils
- java.lang.Object
-
- org.apache.accumulo.server.rpc.TServerUtils
-
public class TServerUtils extends Object
Factory methods for creating Thrift server objects
-
-
Field Summary
Fields Modifier and Type Field Description static ThreadLocal<String>
clientAddress
Static instance, passed toClientInfoProcessorFactory
, which will contain the client address of any incoming RPC.
-
Constructor Summary
Constructors Constructor Description TServerUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HostAndPort[]
getHostAndPorts(String hostname, IntStream ports)
static ServerAddress
startServer(ServerContext context, String hostname, Property portHintProperty, org.apache.thrift.TProcessor processor, String serverName, String threadName, Property portSearchProperty, Property minThreadProperty, Property threadTimeOutProperty, Property timeBetweenThreadChecksProperty, Property maxMessageSizeProperty)
Start a server, at the given port, or higher, if that port is not available.static ServerAddress
startTServer(AccumuloConfiguration conf, ThriftServerType serverType, org.apache.thrift.TProcessor processor, String serverName, String threadName, int numThreads, long threadTimeOut, long timeBetweenThreadChecks, long maxMessageSize, SslConnectionParams sslParams, SaslServerConnectionParams saslParams, long serverSocketTimeout, HostAndPort... addresses)
-
-
-
Field Detail
-
clientAddress
public static final ThreadLocal<String> clientAddress
Static instance, passed toClientInfoProcessorFactory
, which will contain the client address of any incoming RPC.
-
-
Method Detail
-
getHostAndPorts
public static HostAndPort[] getHostAndPorts(String hostname, IntStream ports)
- Parameters:
hostname
- name of the hostports
- array of ports- Returns:
- array of HostAndPort objects
-
startServer
public static ServerAddress startServer(ServerContext context, String hostname, Property portHintProperty, org.apache.thrift.TProcessor processor, String serverName, String threadName, Property portSearchProperty, Property minThreadProperty, Property threadTimeOutProperty, Property timeBetweenThreadChecksProperty, Property maxMessageSizeProperty) throws UnknownHostException
Start a server, at the given port, or higher, if that port is not available.- Parameters:
context
- RPC configurationportHintProperty
- the port to attempt to open, can be zero, meaning "any available port"processor
- the service to be startedserverName
- the name of the class that is providing the servicethreadName
- name this service's thread for better debuggingportSearchProperty
- A boolean Property to control if port-search should be used, or null to disableminThreadProperty
- A Property to control the minimum number of threads in the pooltimeBetweenThreadChecksProperty
- A Property to control the amount of time between checks to resize the thread poolmaxMessageSizeProperty
- A Property to control the maximum Thrift message size accepted- Returns:
- the server object created, and the port actually used
- Throws:
UnknownHostException
- when we don't know our own address
-
startTServer
public static ServerAddress startTServer(AccumuloConfiguration conf, ThriftServerType serverType, org.apache.thrift.TProcessor processor, String serverName, String threadName, int numThreads, long threadTimeOut, long timeBetweenThreadChecks, long maxMessageSize, SslConnectionParams sslParams, SaslServerConnectionParams saslParams, long serverSocketTimeout, HostAndPort... addresses)
-
-