Package org.apache.accumulo.core.rpc
Class TTimeoutTransport
- java.lang.Object
-
- org.apache.accumulo.core.rpc.TTimeoutTransport
-
public class TTimeoutTransport extends Object
A utility class for setting up aTTransport
with various necessary configurations for ideal performance in Accumulo. These configurations include:- Setting SO_LINGER=false on the socket.
- Setting TCP_NO_DELAY=true on the socket.
- Setting timeouts on the I/OStreams.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.thrift.transport.TTransport
create(HostAndPort addr, long timeoutMillis)
Creates a Thrift TTransport to the given address with the given timeout.
-
-
-
Method Detail
-
create
public static org.apache.thrift.transport.TTransport create(HostAndPort addr, long timeoutMillis) throws org.apache.thrift.transport.TTransportException
Creates a Thrift TTransport to the given address with the given timeout. All created resources are closed if an exception is thrown.- Parameters:
addr
- The address to connect the client totimeoutMillis
- The timeout in milliseconds for the connection- Returns:
- A TTransport connected to the given
addr
- Throws:
org.apache.thrift.transport.TTransportException
- If the transport fails to be created/connected
-
-