Package org.apache.thrift.transport

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


  public void run() {
        TSocket transport = new TSocket(indexServerHost, indexServerPort + 1);
        TProtocol protocol = new TBinaryProtocol(transport);
        client = new Indexer.Client(protocol);
        try {
            transport.open();
            IndexStorage storage = getStorage();
            logger.debug("Using environment: " + environment);
            Iterable<Pair<String, BoostedDocument>> allDocuments = storage.getAllDocuments(true, timestamp);
            logger.info("Starting recovery.");
            if (ie != null) ie.setStatus(IndexerStatus.recovering);
View Full Code Here


    public void updateSingleDymamicDatum() {
        TSocket transport = new TSocket(indexServerHost, indexServerPort + 1);
        TProtocol protocol = new TBinaryProtocol(transport);
        client = new Indexer.Client(protocol);
        try {
            transport.open();
            IndexStorage storage = getStorage();
            BufferedReader in = new BufferedReader(new InputStreamReader(System.in), 200);
            String docId;
            System.out.println("Enter the document Ids to recover, separated by enters.\nHit ctr-d to end.");
            while ((docId = in.readLine()) != null && docId.length() != 0) {
View Full Code Here

    try
    {
      TTransport transport = new TSocket(host, port);
      TProtocol protocol = new TBinaryProtocol(transport);
      client = new HiveClient(protocol);
      transport.open();
    }
    catch(Throwable t)
    {
      throw new WindowingException("Failed to connect to Hive Thrift Server", t);
    }
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

     */
    private Cassandra.Client getClient() throws TTransportException {
        TTransport tr = new TSocket("localhost", 9170);
        TProtocol proto = new TBinaryProtocol(tr);
        Cassandra.Client client = new Cassandra.Client(proto);
        tr.open();
        return client;
    }
}
View Full Code Here

        TSocket socket = new TSocket(ConfigHelper.getInitialAddress(conf), ConfigHelper.getThriftPort(conf));
        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

            TSocket socket = new TSocket(range.endpoints.get(0), ConfigHelper.getThriftPort(conf));
            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

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

                Map<String,String> tokenToHostMap = (Map<String,String>) JSONValue.parse(client.get_string_property(CassandraServer.TOKEN_MAP));
               
                BiMap<Token, InetAddress> tokenEndpointMap = HashBiMap.create();
                for (Map.Entry<String,String> entry : tokenToHostMap.entrySet())
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

    server.start();
    Thread.sleep(1000);

    for (int i = 0; i < transports.length ; i++) {
      TSocket transport = new TSocket("localhost", port);
      transport.open();
      transports[i] = transport;
      clients[i] = new HiveClient(new TBinaryProtocol(transport));
    }
  }
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.