public class ThreadLocalClientProvider extends AbstractClientProvider
AbstractClientProvider.EndpointStrategy, AbstractClientProvider.RandomEndpointStrategy, AbstractClientProvider.TimeLimitEndpointStrategy
initialized
Constructor and Description |
---|
ThreadLocalClientProvider(org.apache.hadoop.conf.Configuration conf,
org.apache.twill.discovery.DiscoveryServiceClient discoveryServiceClient) |
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 ThreadLocalClientProvider(org.apache.hadoop.conf.Configuration conf, org.apache.twill.discovery.DiscoveryServiceClient discoveryServiceClient)
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 © 2016 The Apache Software Foundation. All rights reserved.