public class SingleUseClientProvider extends AbstractClientProvider
AbstractClientProvider.EndpointStrategy, AbstractClientProvider.RandomEndpointStrategy, AbstractClientProvider.TimeLimitEndpointStrategyinitialized| 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, newClientpublic 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
ThriftClientProviderorg.apache.thrift.TExceptionTimeoutExceptionInterruptedExceptionpublic void returnClient(TransactionServiceThriftClient client)
ThriftClientProviderclient - The client to returnCopyright © 2018 The Apache Software Foundation. All rights reserved.