public class ThreadLocalClientProvider extends AbstractClientProvider
AbstractClientProvider.EndpointStrategy, AbstractClientProvider.RandomEndpointStrategy, AbstractClientProvider.TimeLimitEndpointStrategyinitialized| Constructor and Description |
|---|
ThreadLocalClientProvider(org.apache.hadoop.conf.Configuration conf,
org.apache.twill.discovery.DiscoveryServiceClient discoveryServiceClient) |
| Modifier and Type | Method and Description |
|---|---|
void |
discardClient(TransactionServiceThriftClient client)
Discard an tx client from the provider's pool.
|
TransactionServiceThriftClient |
getClient()
Retrieve an tx client for exclusive use by the current thread.
|
void |
returnClient(TransactionServiceThriftClient client)
Release an tx client back to the provider's pool.
|
String |
toString() |
initialize, newClient, newClientpublic ThreadLocalClientProvider(org.apache.hadoop.conf.Configuration conf,
org.apache.twill.discovery.DiscoveryServiceClient discoveryServiceClient)
public TransactionServiceThriftClient getClient() throws org.apache.thrift.TException
ThriftClientProviderorg.apache.thrift.TExceptionpublic void returnClient(TransactionServiceThriftClient client)
ThriftClientProviderclient - The client to releasepublic void discardClient(TransactionServiceThriftClient client)
ThriftClientProviderclient - The client to discardCopyright © 2015. All Rights Reserved.