/** * 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); }
public TabletServerStatus getTableMap(boolean usePooledConnection) throws TException, ThriftSecurityException { if (usePooledConnection) throw new UnsupportedOperationException(); long start = System.currentTimeMillis(); TTransport transport = ThriftUtil.createTransport(address, context); try { TabletClientService.Client client = ThriftUtil .createClient(new TabletClientService.Client.Factory(), transport); TabletServerStatus status = client.getTabletServerStatus(Tracer.traceInfo(), context.rpcCreds()); if (status != null) { status.setResponseTime(System.currentTimeMillis() - start); } return status; } finally { if (transport != null) transport.close(); } }
Pair<String,TTransport> pair = ThriftTransportPool.getInstance().getAnyTransport(servers, preferCachedConnections); CT client = ThriftUtil.createClient(factory, pair.getSecond()); opened = true; warnedAboutTServersBeingDown = false;
@Override public void ping(String tserver) throws AccumuloException { TTransport transport = null; try { transport = ThriftUtil.createTransport(AddressUtil.parseAddress(tserver, false), context); TabletClientService.Client client = ThriftUtil .createClient(new TabletClientService.Client.Factory(), transport); client.getTabletServerStatus(Tracer.traceInfo(), context.rpcCreds()); } catch (TException e) { throw new AccumuloException(e); } finally { if (transport != null) { transport.close(); } } }
public void assignTablet(ZooLock lock, KeyExtent extent) throws TException { if (extent.isMeta()) { // see ACCUMULO-3597 try (TTransport transport = ThriftUtil.createTransport(address, context)) { TabletClientService.Client client = ThriftUtil .createClient(new TabletClientService.Client.Factory(), transport); loadTablet(client, lock, extent); } } else { TabletClientService.Client client = ThriftUtil .getClient(new TabletClientService.Client.Factory(), address, context); try { loadTablet(client, lock, extent); } finally { ThriftUtil.returnClient(client); } } }
transport = createClient(wrappingSslSockFactory, address.getHost(), address.getPort(), timeout);
/** * Create a Thrift client using the given factory with a pooled transport (if available) using the * address, client context and timeou * * @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); }
public TabletServerStatus getTableMap(boolean usePooledConnection) throws TException, ThriftSecurityException { if (usePooledConnection == true) throw new UnsupportedOperationException(); long start = System.currentTimeMillis(); TTransport transport = ThriftUtil.createTransport(address, context); try { TabletClientService.Client client = ThriftUtil .createClient(new TabletClientService.Client.Factory(), transport); TabletServerStatus status = client.getTabletServerStatus(Tracer.traceInfo(), context.rpcCreds()); if (status != null) { status.setResponseTime(System.currentTimeMillis() - start); } return status; } finally { if (transport != null) transport.close(); } }
Pair<String,TTransport> pair = ThriftTransportPool.getInstance().getAnyTransport(servers, preferCachedConnections); ClientService.Client client = ThriftUtil.createClient(new ClientService.Client.Factory(), pair.getSecond()); opened = true;
transport = createClient(wrappingSslSockFactory, address.getHost(), address.getPort(), timeout);
public void assignTablet(ZooLock lock, KeyExtent extent) throws TException { if (extent.isMeta()) { // see ACCUMULO-3597 TTransport transport = ThriftUtil.createTransport(address, context); try { TabletClientService.Client client = ThriftUtil .createClient(new TabletClientService.Client.Factory(), transport); loadTablet(client, lock, extent); } finally { transport.close(); } } else { TabletClientService.Client client = ThriftUtil .getClient(new TabletClientService.Client.Factory(), address, context); try { loadTablet(client, lock, extent); } finally { ThriftUtil.returnClient(client); } } }
@Override public void ping(String tserver) throws AccumuloException { TTransport transport = null; try { transport = ThriftUtil.createTransport(AddressUtil.parseAddress(tserver, false), context); TabletClientService.Client client = ThriftUtil .createClient(new TabletClientService.Client.Factory(), transport); client.getTabletServerStatus(Tracer.traceInfo(), context.rpcCreds()); } catch (TTransportException e) { throw new AccumuloException(e); } catch (ThriftSecurityException e) { throw new AccumuloException(e); } catch (TException e) { throw new AccumuloException(e); } finally { if (transport != null) { transport.close(); } } }