@Override public void open() throws TTransportException { try { transport.open(); } catch (TTransportException e) { throw rewriteException(e, address); } }
@Override public void open() throws TTransportException { wrapped.open(); }
@Override public void open() throws TTransportException { wrapped.open(); }
public Void run() { try { wrapped.open(); } catch (TTransportException tte) { // Wrap the transport exception in an RTE, since UGI.doAs() then goes // and unwraps this for us out of the doAs block. We then unwrap one // more time in our catch clause to get back the TTE. (ugh) throw new RuntimeException(tte); } return null; } });
public Void run() { try { wrapped.open(); } catch (TTransportException tte) { // Wrap the transport exception in an RTE, since UGI.doAs() then goes // and unwraps this for us out of the doAs block. We then unwrap one // more time in our catch clause to get back the TTE. (ugh) throw new RuntimeException(tte); } return null; } });
public Void run() { try { wrapped.open(); } catch (TTransportException tte) { // Wrap the transport exception in an RTE, since Subject.doAs() then goes // and unwraps this for us out of the doAs block. We then unwrap one // more time in our catch clause to get back the TTE. (ugh) throw new RuntimeException(tte); } return null; } });
public Void run() { try { LOG.debug("do as:" + principal); sasalTransport.open(); } catch (Exception e) { LOG.error("Client failed to open SaslClientTransport to interact with a server during session initiation: " + e, e); } return null; } });
/** * Connect to the specified server via framed transport * * @param transport The underlying Thrift transport. * @param serverHost unused. * @param asUser unused. */ @Override public TTransport connect(TTransport transport, String serverHost, String asUser) throws TTransportException { int maxBufferSize = type.getMaxBufferSize(storm_conf); // create a framed transport TTransport conn = new TFramedTransport(transport, maxBufferSize); // connect conn.open(); LOG.debug("Simple client transport has been established"); return conn; }
transport.open();
/** * Connect to Thrift Server. * * @throws TException the t exception */ public void connect() throws TException { transport = new TSocket(host, port); TProtocol protocol = new TBinaryProtocol(transport); TMultiplexedProtocol mp = new TMultiplexedProtocol(protocol, KaaThriftService.KAA_NODE_SERVICE.getServiceName()); client = new CliClient(mp); transport.open(); remoteServerName = client.serverName(); remoteMode = true; }
@Override public void run() { try { LOG.debug("Call Thrift server [" + endpointHost + ":" + endpointPort + "]"); transport.open(); if (activity != null) { invoke(activity); LOG.debug("Successfuly invoke Thrift server [" + endpointHost + ":" + endpointPort + "]"); activity.isSuccess(true); } else { LOG.error( "Error - Activity not set while invoke thrift object " + endpointHost + ":" + endpointPort); } } catch (TException | IllegalArgumentException | SecurityException ex) { LOG.error( "Unexpected error occurred while invoke thrift object " + endpointHost + ":" + endpointPort, ex); if (activity != null) { activity.isSuccess(false); } } finally { transport.close(); } }
private void openTransport() throws Exception { assumeSubject = JdbcConnectionParams.AUTH_KERBEROS_AUTH_TYPE_FROM_SUBJECT.equals(sessConfMap .get(JdbcConnectionParams.AUTH_KERBEROS_AUTH_TYPE)); transport = isHttpTransportMode() ? createHttpTransport() : createBinaryTransport(); if (!transport.isOpen()) { transport.open(); } logZkDiscoveryMessage("Connected to " + connParams.getHost() + ":" + connParams.getPort()); }
transport.open();
if (!isTest) { TTransport transport = new TSocket(intpEventServerHost, intpEventServerPort); transport.open(); TProtocol protocol = new TBinaryProtocol(transport); intpEventServiceClient = new RemoteInterpreterEventService.Client(protocol);
Cassandra.Client client = new Cassandra.Client(protocol); if (!transport.isOpen()) { transport.open();
private void run() throws Exception { TTransport transport = new TSocket(host, port); transport.open(); String url = "http://" + host + ":" + port; THttpClient httpClient = new THttpClient(url);
public static TTransport create( HostAndPort address, Optional<SSLContext> sslContext, Optional<HostAndPort> socksProxy, int timeoutMillis, HiveMetastoreAuthentication authentication) throws TTransportException { try { TTransport rawTransport = createRaw(address, sslContext, socksProxy, timeoutMillis); TTransport authenticatedTransport = authentication.authenticate(rawTransport, address.getHost()); if (!authenticatedTransport.isOpen()) { authenticatedTransport.open(); } return new TTransportWrapper(authenticatedTransport, address); } catch (TTransportException e) { throw rewriteException(e, address); } }
protected synchronized TTransport connect(HiveConf conf) throws HiveSQLException, TTransportException { if (transport != null && transport.isOpen()) { transport.close(); } String host = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST); int port = conf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT); LOG.info("Connecting to " + host + ":" + port); transport = new TSocket(host, port); ((TSocket) transport).setTimeout((int) conf.getTimeVar(HiveConf.ConfVars.SERVER_READ_SOCKET_TIMEOUT, TimeUnit.SECONDS) * 1000); try { ((TSocket) transport).getSocket().setKeepAlive(conf.getBoolVar(HiveConf.ConfVars.SERVER_TCP_KEEP_ALIVE)); } catch (SocketException e) { LOG.error("Error setting keep alive to " + conf.getBoolVar(HiveConf.ConfVars.SERVER_TCP_KEEP_ALIVE), e); } String userName = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_CLIENT_USER); String passwd = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_CLIENT_PASSWORD); try { transport = PlainSaslHelper.getPlainTransport(userName, passwd, transport); } catch (SaslException e) { LOG.error("Error creating plain SASL transport", e); } TProtocol protocol = new TBinaryProtocol(transport); transport.open(); base = new ThriftCLIServiceClient(new TCLIService.Client(protocol), conf); LOG.info("Connected!"); return transport; }
transport.open(); LOG.info("Opened a connection to metastore, current connections");
try { if (!transport.isOpen()) { transport.open(); LOG.info("Opened a connection to metastore, current connections: " + connCount.incrementAndGet());