public TTransport getTransport(HostAndPort location, long milliseconds, ClientContext context) throws TTransportException { return getTransport(new ThriftTransportKey(location, milliseconds, context)); }
/** * Create a Thrift client using the given factory with a pooled transport (if available) using the * address, client context and timeout * * @param factory * Thrift client factory * @param address * Server address for client to connect to * @param context * RPC options * @param timeout * Socket timeout which overrides the ClientContext timeout */ public static <T extends TServiceClient> T getClient(TServiceClientFactory<T> factory, HostAndPort address, ClientContext context, long timeout) throws TTransportException { TTransport transport = ThriftTransportPool.getInstance().getTransport(address, timeout, context); return createClient(factory, transport); }
/** * Create a Thrift client using the given factory with a pooled transport (if available), the * address and client context. Client timeout is extracted from the ClientContext * * @param factory * Thrift client factory * @param address * Server address for client to connect to * @param context * RPC options */ public static <T extends TServiceClient> T getClient(TServiceClientFactory<T> factory, HostAndPort address, ClientContext context) throws TTransportException { TTransport transport = ThriftTransportPool.getInstance().getTransport(address, context.getClientTimeoutInMillis(), context); return createClient(factory, transport); }