Package org.apache.thrift.transport

Examples of org.apache.thrift.transport.TFramedTransport.open()


        int port = Integer.parseInt(getProperties().getProperty(PORT, PORT_DEFAULT));
        TTransport tr = new TFramedTransport(new TSocket(host, port));
        TProtocol proto = new TBinaryProtocol(tr);
        c = new MapKeeper.Client(proto);
        try {
            tr.open();
            initDB(getProperties(), c);
        } catch(TException e) {
            throw new RuntimeException(e);
        }
        writeallfields = Boolean.parseBoolean(getProperties().getProperty(CoreWorkload.WRITE_ALL_FIELDS_PROPERTY,
View Full Code Here


   */
  public static DNodeService.Client get(String host, int port) throws TTransportException {
    TTransport transport = new TFramedTransport(new TSocket(host, port));
    TProtocol protocol = new TBinaryProtocol(transport);
    DNodeService.Client client = new DNodeService.Client(protocol);
    transport.open();
    return client;   
  }
 
  /**
   * It is not trivial to properly close a Thrift client. This method encapsulates this.
View Full Code Here

        private static Cassandra.Client createThriftClient(String host, int port) throws TTransportException
        {
            TSocket socket = new TSocket(host, port);
            TTransport trans = new TFramedTransport(socket);
            trans.open();
            TProtocol protocol = new org.apache.thrift.protocol.TBinaryProtocol(trans);
            return new Cassandra.Client(protocol);
        }
    }
View Full Code Here

  private Cassandra.Client client(Instance instance) throws TException
  {
    TTransport trans = new TFramedTransport(new TSocket(
        instance.getPublicAddress().getHostAddress(),
        CassandraClusterActionHandler.CLIENT_PORT));
    trans.open();
    TBinaryProtocol protocol = new TBinaryProtocol(trans);
    return new Cassandra.Client(protocol);
  }

  private void waitForCassandra() {
View Full Code Here

        TSocket socket = new TSocket(host, port, timeout);
        socket.getSocket().setTcpNoDelay(true);
        socket.getSocket().setKeepAlive(true);
        socket.getSocket().setSoLinger(true, 0);
        TTransport transport = new TFramedTransport(socket);
        transport.open();

        TProtocol protocol = new TBinaryProtocol(transport);

        return new SuroServer.Client(protocol);
    }
View Full Code Here

            socket = new TSocket(server.getHost(), server.getPort(), 2000);
            socket.getSocket().setTcpNoDelay(true);
            socket.getSocket().setKeepAlive(true);
            socket.getSocket().setSoLinger(true, 0);
            transport = new TFramedTransport(socket);
            transport.open();
            return true;
        } catch (TTransportException e) {
            logger.warn("Ping {}", e.getMessage());
            return false;
        } catch (SocketException e) {
View Full Code Here

    private Brisk.Iface getConnection() throws IOException
    {
        TTransport trans = new TFramedTransport(new TSocket(host, port));
        try
        {
            trans.open();
        }
        catch (TTransportException e)
        {
            throw new IOException("unable to connect to brisk server");
        }
View Full Code Here

        private static Cassandra.Client createThriftClient(String host, int port, String user, String passwd) throws Exception
        {
            TSocket socket = new TSocket(host, port);
            TTransport trans = new TFramedTransport(socket);
            trans.open();
            TProtocol protocol = new TBinaryProtocol(trans);
            Cassandra.Client client = new Cassandra.Client(protocol);
            if (user != null && passwd != null)
            {
                Map<String, String> credentials = new HashMap<String, String>();
View Full Code Here

        private static Cassandra.Client createThriftClient(String host, int port) throws TTransportException
        {
            TSocket socket = new TSocket(host, port);
            TTransport trans = new TFramedTransport(socket);
            trans.open();
            TProtocol protocol = new org.apache.thrift.protocol.TBinaryProtocol(trans);
            return new Cassandra.Client(protocol);
        }
    }
View Full Code Here

            log.debug("Creating TSocket({}, {}, {}, {}, {})", hostname, cfg.port, cfg.username, cfg.password, cfg.timeoutMS);

        TTransport transport = new TFramedTransport(new TSocket(hostname, cfg.port, cfg.timeoutMS), cfg.frameSize);
        TBinaryProtocol protocol = new TBinaryProtocol(transport);
        Cassandra.Client client = new Cassandra.Client(protocol);
        transport.open();

        if (cfg.username != null) {
            Map<String, String> credentials = new HashMap<String, String>() {{
                put(IAuthenticator.USERNAME_KEY, cfg.username);
                put(IAuthenticator.PASSWORD_KEY, cfg.password);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.