Class TTimeoutTransport


  • public class TTimeoutTransport
    extends Object
    A utility class for setting up a TTransport 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 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 to
        timeoutMillis - 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