/** * Return the transport used by the client to the shared pool. * * @param iface * The Client being returned or null. */ public static void returnClient(TServiceClient iface) { // Eew... the typing here is horrible if (iface != null) { ThriftTransportPool.getInstance().returnTransport(iface.getInputProtocol().getTransport()); } }
public static void close(TServiceClient client) { if (client != null && client.getInputProtocol() != null && client.getInputProtocol().getTransport() != null) { ThriftTransportPool.getInstance().returnTransport(client.getInputProtocol().getTransport()); } else { log.debug("Attempt to close null connection to a server", new Exception()); } } }
public static void close(MasterClientService.Iface iface) { TServiceClient client = (TServiceClient) iface; if (client != null && client.getInputProtocol() != null && client.getInputProtocol().getTransport() != null) { ThriftTransportPool.getInstance().returnTransport(client.getInputProtocol().getTransport()); } else { log.debug("Attempt to close null connection to the master", new Exception()); } }
private static void close(TServiceClient client) { if (client != null && client.getInputProtocol() != null && client.getInputProtocol().getTransport() != null) { ThriftTransportPool.getInstance().returnTransport(client.getInputProtocol().getTransport()); } else { log.debug("Attempt to close null connection to the remote system", new Exception()); } }
throw new IOException(e); } finally { ThriftTransportPool.getInstance().returnTransport(transport);