@Override public void close() throws SQLException { if (!isClosed) { TCloseSessionReq closeReq = new TCloseSessionReq(sessHandle); try { client.CloseSession(closeReq); } catch (TException e) { throw new SQLException("Error while cleaning up the server resources", e); } finally { isClosed = true; if (transport != null) { transport.close(); } } } }
@Override public void close() throws SQLException { if (!isClosed) { TCloseSessionReq closeReq = new TCloseSessionReq(sessHandle); try { client.CloseSession(closeReq); } catch (TException e) { throw new SQLException("Error while cleaning up the server resources", e); } finally { isClosed = true; if (transport != null) { transport.close(); } } } }
private TTransport createHttpTransport() throws SQLException, TTransportException { CloseableHttpClient httpClient; boolean useSsl = isSslConnection(); // Create an http client from the configs httpClient = getHttpClient(useSsl); try { transport = new THttpClient(getServerHttpUrl(useSsl), httpClient); // We'll call an open/close here to send a test HTTP message to the server. Any // TTransportException caused by trying to connect to a non-available peer are thrown here. // Bubbling them up the call hierarchy so that a retry can happen in openTransport, // if dynamic service discovery is configured. TCLIService.Iface client = new TCLIService.Client(new TBinaryProtocol(transport)); TOpenSessionResp openResp = client.OpenSession(new TOpenSessionReq()); if (openResp != null) { client.CloseSession(new TCloseSessionReq(openResp.getSessionHandle())); } } catch (TException e) { LOG.info("JDBC Connection Parameters used : useSSL = " + useSsl + " , httpPath = " + sessConfMap.get(JdbcConnectionParams.HTTP_PATH) + " Authentication type = " + sessConfMap.get(JdbcConnectionParams.AUTH_TYPE)); String msg = "Could not create http connection to " + jdbcUriString + ". " + e.getMessage(); throw new TTransportException(msg, e); } return transport; }
private TTransport createHttpTransport() throws SQLException, TTransportException { CloseableHttpClient httpClient; boolean useSsl = isSslConnection(); // Create an http client from the configs httpClient = getHttpClient(useSsl); try { transport = new THttpClient(getServerHttpUrl(useSsl), httpClient); // We'll call an open/close here to send a test HTTP message to the server. Any // TTransportException caused by trying to connect to a non-available peer are thrown here. // Bubbling them up the call hierarchy so that a retry can happen in openTransport, // if dynamic service discovery is configured. TCLIService.Iface client = new TCLIService.Client(new TBinaryProtocol(transport)); TOpenSessionResp openResp = client.OpenSession(new TOpenSessionReq()); if (openResp != null) { client.CloseSession(new TCloseSessionReq(openResp.getSessionHandle())); } } catch (TException e) { LOG.info("JDBC Connection Parameters used : useSSL = " + useSsl + " , httpPath = " + sessConfMap.get(JdbcConnectionParams.HTTP_PATH) + " Authentication type = " + sessConfMap.get(JdbcConnectionParams.AUTH_TYPE)); String msg = "Could not create http connection to " + jdbcUriString + ". " + e.getMessage(); throw new TTransportException(msg, e); } return transport; }
@Override public void closeSession(SessionHandle sessionHandle) throws HiveSQLException { try { TCloseSessionReq req = new TCloseSessionReq(sessionHandle.toTSessionHandle()); TCloseSessionResp resp = cliService.CloseSession(req); checkStatus(resp.getStatus()); } catch (HiveSQLException e) { throw e; } catch (Exception e) { throw new HiveSQLException(e); } }
public CloseSession_result getResult(I iface, CloseSession_args args) throws org.apache.thrift.TException { CloseSession_result result = new CloseSession_result(); result.success = iface.CloseSession(args.req); return result; } }
@Override public void closeSession(SessionHandle sessionHandle) throws HiveSQLException { try { TCloseSessionReq req = new TCloseSessionReq(sessionHandle.toTSessionHandle()); TCloseSessionResp resp = cliService.CloseSession(req); checkStatus(resp.getStatus()); } catch (HiveSQLException e) { throw e; } catch (Exception e) { throw new HiveSQLException(e); } }
public CloseSession_result getResult(I iface, CloseSession_args args) throws org.apache.thrift.TException { CloseSession_result result = new CloseSession_result(); result.success = iface.CloseSession(args.req); return result; } }
@Override public void closeSession(SessionHandle sessionHandle) throws HiveSQLException { try { TCloseSessionReq req = new TCloseSessionReq(sessionHandle.toTSessionHandle()); TCloseSessionResp resp = cliService.CloseSession(req); checkStatus(resp.getStatus()); } catch (HiveSQLException e) { throw e; } catch (Exception e) { throw new HiveSQLException(e); } }
@Override public void closeSession(SessionHandle sessionHandle) throws HiveSQLException { try { TCloseSessionReq req = new TCloseSessionReq(sessionHandle.toTSessionHandle()); TCloseSessionResp resp = cliService.CloseSession(req); checkStatus(resp.getStatus()); } catch (HiveSQLException e) { throw e; } catch (Exception e) { throw new HiveSQLException(e); } }
public CloseSession_result getResult(I iface, CloseSession_args args) throws org.apache.thrift.TException { CloseSession_result result = new CloseSession_result(); result.success = iface.CloseSession(args.req); return result; } }
public CloseSession_result getResult(I iface, CloseSession_args args) throws org.apache.thrift.TException { CloseSession_result result = new CloseSession_result(); result.success = iface.CloseSession(args.req); return result; } }