Package org.apache.thrift.transport

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


  public AdminRPCThrift(String masterHost, int masterPort) throws IOException {
    TTransport masterTransport = new TSocket(masterHost, masterPort);
    TProtocol protocol = new TBinaryProtocol(masterTransport);
    try {
      masterTransport.open();
    } catch (TTransportException e) {
      throw new IOException(e);
    }
    masterClient = new Client(protocol);
    LOG.info("Connected to master at " + masterHost + ":" + masterPort);
View Full Code Here


        .getScribeSourcePort());
    // scribe clients used framed transports
    transport = new TFramedTransport(transport);
    // scribe clients do not use strict write
    TProtocol protocol = new TBinaryProtocol(transport, false, false);
    transport.open();
    scribe.Client client = new scribe.Client(protocol);

    // Note - there is a tiny possibility of a race here, which is why we retry
    for (int i = 0; i < 3; ++i) {
      if (client.getStatus() != fb_status.ALIVE) {
View Full Code Here

    // Open the client connection
    TTransport transport = new TSocket("localhost", 45872);
    transport = new TFramedTransport(transport);
    // scribe clients do not use strict write
    TProtocol protocol = new TBinaryProtocol(transport, false, false);
    transport.open();
    scribe.Client client = new scribe.Client(protocol);

    // Note - there is a tiny possibility of a race here, which is why we retry
    for (int i = 0; i < 3; ++i) {
      if (client.getStatus() != fb_status.ALIVE) {
View Full Code Here

    int msg_size_mb = Integer.parseInt(args[0]);
    int msg_size = msg_size_mb * 1024 * 1024;

    TSocket socket = new TSocket("localhost", 9090);
    TBinaryProtocol binprot = new TBinaryProtocol(socket);
    socket.open();
    binprot.writeI32(msg_size);
    binprot.writeI32(1);
    socket.flush();

    System.in.read();
View Full Code Here

            try
            {
                TSocket socket = new TSocket(seed, port_);
                TBinaryProtocol binaryProtocol = new TBinaryProtocol(new TFramedTransport(socket));
                Cassandra.Client client = new Cassandra.Client(binaryProtocol);
                socket.open();

                List<TokenRange> ring = client.describe_ring(keyspace);
                rangeMap = ArrayListMultimap.create();
               
                for (TokenRange range : ring)
View Full Code Here

                                     DatabaseDescriptor.getThriftPort());
        TBinaryProtocol binaryProtocol = new TBinaryProtocol(socket, false, false);
        Cassandra.Client client = new Cassandra.Client(binaryProtocol);
        try
        {
            socket.open();
        }
        catch (TTransportException e)
        {
            throw new IOException(e);
        }
View Full Code Here

                                     DatabaseDescriptor.getThriftPort());
        TBinaryProtocol binaryProtocol = new TBinaryProtocol(socket, false, false);
        Cassandra.Client client = new Cassandra.Client(binaryProtocol);
        try
        {
            socket.open();
        }
        catch (TTransportException e)
        {
            throw new IOException(e);
        }
View Full Code Here

    TProtocol protocol = new TBinaryProtocol(transport);
    // This is our thrift client.
    THBaseService.Iface client = new THBaseService.Client(protocol);

    // open the transport
    transport.open();

    ByteBuffer table = ByteBuffer.wrap("example".getBytes());

    TPut put = new TPut();
    put.setRow("row1".getBytes());
View Full Code Here

    TTransport transport = sock;
    if (specifyFramed || implType.isAlwaysFramed) {
      transport = new TFramedTransport(transport);
    }

    sock.open();
    try {
      TProtocol prot;
      if (specifyCompact) {
        prot = new TCompactProtocol(transport);
      } else {
View Full Code Here

      }
    };
    thread.start();

    TTransport transport = new TSocket("127.0.0.1", 2187);
    transport.open();
    TProtocol protocol = new TBinaryProtocol(transport);
    ChronosService.Client client = new ChronosService.Client(protocol);
    client.getTimestamp();
    transport.close();
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.