public class SingleUseClientProvider extends AbstractClientProvider
AbstractClientProvider.EndpointStrategy, AbstractClientProvider.RandomEndpointStrategy, AbstractClientProvider.TimeLimitEndpointStrategy
initialized
Constructor and Description |
---|
SingleUseClientProvider(org.apache.hadoop.conf.Configuration conf,
org.apache.twill.discovery.DiscoveryServiceClient discoveryServiceClient,
int timeout) |
Modifier and Type | Method and Description |
---|---|
CloseableThriftClient |
getCloseableClient()
Retrieve an AutoCloseable wrapper around tx client for exclusive use by the
current thread.
|
void |
returnClient(TransactionServiceThriftClient client)
Release an tx client back to the provider's pool, if the client is valid.
|
String |
toString() |
initialize, newClient, newClient
public SingleUseClientProvider(org.apache.hadoop.conf.Configuration conf, org.apache.twill.discovery.DiscoveryServiceClient discoveryServiceClient, int timeout)
public CloseableThriftClient getCloseableClient() throws org.apache.thrift.TException, TimeoutException, InterruptedException
ThriftClientProvider
org.apache.thrift.TException
TimeoutException
InterruptedException
public void returnClient(TransactionServiceThriftClient client)
ThriftClientProvider
client
- The client to returnCopyright © 2017 The Apache Software Foundation. All rights reserved.