Examples of TSocket


Examples of org.apache.thrift.transport.TSocket

    public CassandraClient getClient(boolean setKeyspace)
    {
        // random node selection for fake load balancing
        String currentNode = nodes[Stress.randomizer.nextInt(nodes.length)];

        TSocket socket = new TSocket(currentNode, port);
        TTransport transport = transportFactory.getTransport(socket);
        CassandraClient client = new CassandraClient(new TBinaryProtocol(transport));

        try
        {
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

      this.port = port;
    }
    public void append(ThriftFlumeEvent evt){
      TTransport transport;
      try {
        transport = new TSocket(host, port);
        TProtocol protocol = new TBinaryProtocol(transport);
        Client client = new Client(protocol);
        transport.open();
        client.append(evt);
        transport.close();
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

            if (socket != null && socket.isOpen())
                return;

            // create connection using thrift
            String location = getLocation();
            socket = new TSocket(location, ConfigHelper.getInputRpcPort(conf));
            TBinaryProtocol binaryProtocol = new TBinaryProtocol(new TFramedTransport(socket));
            client = new Cassandra.Client(binaryProtocol);
            socket.open();

            // log in
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

     * @param port   - Thrift port number
     */
    public static void connect(String server, int port)
    {

        TSocket socket = new TSocket(server, port);

        if (transport != null)
            transport.close();

        if (sessionState.framed)
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

            if (socket != null && socket.isOpen())
                return;

            // create connection using thrift
            String location = getLocation();
            socket = new TSocket(location, ConfigHelper.getRpcPort(conf));
            TBinaryProtocol binaryProtocol = new TBinaryProtocol(new TFramedTransport(socket));
            client = new Cassandra.Client(binaryProtocol);
            socket.open();

            // log in
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

  protected void setUp() throws Exception {
    super.setUp();

    if (standAloneServer) {
      try {
        transport = new TSocket(host, port);
        TProtocol protocol = new TBinaryProtocol(transport);
        client = new HiveClient(protocol);
        transport.open();
      } catch (Throwable e) {
        e.printStackTrace();
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

    }

    private static void setup(String server, int port) throws Exception
    {
        /* Establish a thrift connection to the cassandra instance */
        TSocket socket = new TSocket(server, port);
        TTransport transport;
        System.out.println(" connected to " + server + ":" + port + ".");
        transport = socket;
        TBinaryProtocol binaryProtocol = new TBinaryProtocol(transport, false, false);
        Cassandra.Client cassandraClient = new Cassandra.Client(binaryProtocol);
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

            if (socket != null && socket.isOpen())
                return;

            // create connection using thrift
            String location = getLocation();
            socket = new TSocket(location, ConfigHelper.getInputRpcPort(conf));
            TBinaryProtocol binaryProtocol = new TBinaryProtocol(new TFramedTransport(socket));
            client = new Cassandra.Client(binaryProtocol);
            socket.open();

            // log in
View Full Code Here

Examples of org.apache.thrift7.transport.TSocket

    public NimbusClient(String host, int port) {
        try {
            if(host==null) {
                throw new IllegalArgumentException("Nimbus host is not set");
            }
            conn = new TFramedTransport(new TSocket(host, port));
            client = new Nimbus.Client(new TBinaryProtocol(conn));
            conn.open();
        } catch(TException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of org.apache.thrift7.transport.TSocket

            throw new RuntimeException(e);
        }
    }
   
    private void connect() throws TException {
        conn = new TFramedTransport(new TSocket(host, port));
        client = new DistributedRPC.Client(new TBinaryProtocol(conn));
        conn.open();
    }
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.