public class TTimeoutTransport extends Object
TTransport
with various necessary configurations for
ideal performance in Accumulo. These configurations include:
Modifier and Type | Method and Description |
---|---|
static org.apache.thrift.transport.TTransport |
create(HostAndPort addr,
long timeoutMillis)
Creates a Thrift TTransport to the given address with the given timeout.
|
static org.apache.thrift.transport.TTransport |
create(SocketAddress addr,
long timeoutMillis)
Creates a Thrift TTransport to the given address with the given timeout.
|
protected org.apache.thrift.transport.TTransport |
createInternal(SocketAddress addr,
long timeoutMillis)
Opens a socket to the given
addr , configures the socket, and then creates a Thrift
transport using the socket. |
protected Socket |
openSocket(SocketAddress addr)
Opens and configures a
Socket for Accumulo RPC. |
protected Socket |
openSocketChannel()
Opens a socket channel and returns the underlying socket.
|
protected InputStream |
wrapInputStream(Socket socket,
long timeoutMillis) |
protected OutputStream |
wrapOutputStream(Socket socket,
long timeoutMillis) |
public static org.apache.thrift.transport.TTransport create(HostAndPort addr, long timeoutMillis) throws IOException
addr
- The address to connect the client totimeoutMillis
- The timeout in milliseconds for the connectionaddr
IOException
- If the transport fails to be created/connectedpublic static org.apache.thrift.transport.TTransport create(SocketAddress addr, long timeoutMillis) throws IOException
addr
- The address to connect the client totimeoutMillis
- The timeout in milliseconds for the connectionaddr
IOException
- If the transport fails to be created/connectedprotected org.apache.thrift.transport.TTransport createInternal(SocketAddress addr, long timeoutMillis) throws IOException
addr
, configures the socket, and then creates a Thrift
transport using the socket.addr
- The address the socket should connecttimeoutMillis
- The socket timeout in millisecondsaddr
IOException
- If the Thrift client is failed to be connected/createdprotected InputStream wrapInputStream(Socket socket, long timeoutMillis) throws IOException
IOException
protected OutputStream wrapOutputStream(Socket socket, long timeoutMillis) throws IOException
IOException
protected Socket openSocket(SocketAddress addr) throws IOException
Socket
for Accumulo RPC.addr
- The address to connect the socket toIOException
protected Socket openSocketChannel() throws IOException
IOException
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.