/** * 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 = new TFramedTransport(transport); } else if (secure) {
TTransport transport = new TFramedTransport(socket, cfg.frameSize); log.trace("Created transport {}", transport); TBinaryProtocol protocol = new TBinaryProtocol(transport);
@Override public Pair<THBaseService.Client, TTransport> getClient() throws IOException { TSocket sock = new TSocket(connection.getHost(), connection.getPort()); sock.setSocketTimeout(connection.getOperationTimeout()); sock.setConnectTimeout(connection.getConnectTimeout()); TTransport tTransport = sock; if (connection.isFramed()) { tTransport = new TFramedTransport(tTransport); } try { sock.open(); } catch (TTransportException e) { throw new IOException(e); } TProtocol prot; if (connection.isCompact()) { prot = new TCompactProtocol(tTransport); } else { prot = new TBinaryProtocol(tTransport); } THBaseService.Client client = new THBaseService.Client(prot); return new Pair<>(client, tTransport); }
transport = new TFramedTransport(transport);
transport = new TFramedTransport(transport);
protected void talkToThriftServer() throws Exception { TSocket sock = new TSocket(InetAddress.getLocalHost().getHostName(), port); TTransport transport = sock; if (specifyFramed || implType.isAlwaysFramed) { transport = new TFramedTransport(transport); } sock.open(); try { TProtocol prot; if (specifyCompact) { prot = new TCompactProtocol(transport); } else { prot = new TBinaryProtocol(transport); } Hbase.Client client = new Hbase.Client(prot); if (!tableCreated){ TestThriftServer.createTestTables(client); tableCreated = true; } TestThriftServer.checkTableList(client); } finally { sock.close(); } }
@Override public TTransport getTransport(TTransport base) { return new TFramedTransport(base, maxLength_); } }
TTransport transport = sock; if (specifyFramed || implType.isAlwaysFramed()) { transport = new TFramedTransport(transport);
transport = new TFramedTransport(transport);
protected TTransport maybeWrapWithTFramedTransport(TTransport transport) { if (cassandraHost.getUseThriftFramedTransport()) { return new TFramedTransport(transport, cassandraHost.getMaxFrameSize()); } else { return transport; } }
.parseInt((String) externalProperties.get(CassandraConstants.THRIFT_PORT)) : Integer.parseInt(port); TSocket socket = new TSocket(host, thriftPort); TTransport transport = new TFramedTransport(socket); TProtocol protocol = new TBinaryProtocol(transport, true, true); cassandra_client = new Cassandra.Client(protocol);
/** * Inits the client. * * @throws TTransportException * the t transport exception */ public static void initClient() throws TTransportException { TSocket socket = new TSocket("127.0.0.1", 9160); TTransport transport = new TFramedTransport(socket); TProtocol protocol = new TBinaryProtocol(transport, true, true); client = new Cassandra.Client(protocol); socket.open(); }
/** * Inits the client. * * @param port * @param ip * * @throws TTransportException * the t transport exception */ public static void initClient(String ip, int port) throws TTransportException { TSocket socket = new TSocket(ip, port); TTransport transport = new TFramedTransport(socket); TProtocol protocol = new TBinaryProtocol(transport, true, true); client = new Cassandra.Client(protocol); socket.open(); }
new TFramedTransport(thriftSocket, CassandraConstants.CLIENT_MAX_THRIFT_FRAME_SIZE_BYTES); TProtocol protocol = new TBinaryProtocol(thriftFramedTransport); Cassandra.Client client = new Cassandra.Client(protocol);
@Override public TTransport getTransport(TTransport base) { return new TFramedTransport(base, maxLength_); } }
private void connectToHsHaServer() { this.transport = new TFramedTransport(new TSocket(host, port)); this.protocol = new TBinaryProtocol(transport); this.client = new Send.Client(protocol); try { this.transport.open(); } catch (TTransportException e) { this.transport.close(); } }
private void connectToTheadSelectorServer() { this.transport = new TFramedTransport(new TSocket(host, port)); this.protocol = new TBinaryProtocol(transport); this.client = new Send.Client(protocol); try { this.transport.open(); } catch (TTransportException e) { this.transport.close(); } }
private void dropOldKeyspace() throws InvalidRequestException, SchemaDisagreementException, TException { TTransport tr = new TFramedTransport(new TSocket("localhost", 9160)); TProtocol proto = new TBinaryProtocol(tr); Cassandra.Client client = new Cassandra.Client(proto); tr.open(); client.system_drop_keyspace(JANUSGRAPH); LOGGER.info("DROPPED keyspace janusgraph"); tr.close(); }
private Cassandra.Client client(Instance instance) throws TException { TTransport trans = new TFramedTransport(new TSocket( instance.getPublicIp(), CassandraClusterActionHandler.CLIENT_PORT)); trans.open(); TBinaryProtocol protocol = new TBinaryProtocol(trans); return new Cassandra.Client(protocol); }