Package org.apache.thrift.transport

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


            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>) new JSONTokener(client.get_string_property(CassandraServer.TOKEN_MAP)).nextValue();
               
                BiMap<Token, InetAddress> tokenEndpointMap = HashBiMap.create();
                for (Map.Entry<String,String> entry : tokenToHostMap.entrySet())
View Full Code Here


      port = mConf.getInt(FLUME_MASTER_PORT_KEY, DEFAULT_FLUME_MASTER_PORT);
    }
   
    TTransport masterTransport = new TSocket(host, port);
    TProtocol protocol = new TBinaryProtocol(masterTransport);
    masterTransport.open();
    mMasterClient = new Client(protocol);
  }
}
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

  }
 
  private void getScanner(InetAddress thriftAddress) throws Exception {
    TTransport transport = new TSocket(thriftAddress.getHostName(),
        HBaseThriftServerClusterActionHandler.PORT);
    transport.open();
    LOG.info("Connected to thrift server.");
    LOG.info("Waiting for .META. table...");
    TProtocol protocol = new TBinaryProtocol(transport, true, true);
    Hbase.Client client = new Hbase.Client(protocol);
    int scannerId = client.scannerOpen(ByteBuffer.wrap(HConstants.META_TABLE_NAME),
View Full Code Here

      TTransport transport = new TSocket("localhost", 9090);
      TProtocol protocol = new TBinaryProtocol(transport);
      Calculator.Client client = new Calculator.Client(protocol);

      transport.open();

      client.ping();
      System.out.println("ping()");

      int sum = client.add(1,1);
View Full Code Here

  }
 
  private void getScanner(InetAddress thriftAddress) throws Exception {
    TTransport transport = new TSocket(thriftAddress.getHostName(),
        HBaseThriftServerClusterActionHandler.PORT);
    transport.open();
    LOG.info("Connected to thrift server.");
    LOG.info("Waiting for .META. table...");
    TProtocol protocol = new TBinaryProtocol(transport, true, true);
    Hbase.Client client = new Hbase.Client(protocol);
    int scannerId = client.scannerOpen(ByteBuffer.wrap(HConstants.META_TABLE_NAME),
View Full Code Here

    for (Instance instance : cluster.getInstances()) {
      while (true) {
        try {
          TSocket socket = new TSocket(instance.getPublicAddress()
              .getHostAddress(), CassandraService.CLIENT_PORT);
          socket.open();
          TBinaryProtocol protocol = new TBinaryProtocol(socket);
          Cassandra.Client client = new Cassandra.Client(protocol);
          client.describe_cluster_name();
          socket.close();
          break;
View Full Code Here

  public void testInstances() throws Exception {
    Set<String> endPoints = new HashSet<String>();
    for (Instance instance : cluster.getInstances()) {
      TSocket socket = new TSocket(instance.getPublicAddress().getHostAddress(),
          CassandraService.CLIENT_PORT);
      socket.open();
      TBinaryProtocol protocol = new TBinaryProtocol(socket);
      Cassandra.Client client = new Cassandra.Client(protocol);
      List<TokenRange> tr = client.describe_ring(KEYSPACE);
      for (TokenRange tokenRange : tr) {
        endPoints.addAll(tokenRange.endpoints);
View Full Code Here

    for (Instance instance : cluster.getInstances()) {
      while (true) {
        try {
          TSocket socket = new TSocket(instance.getPublicAddress()
              .getHostAddress(), CassandraService.CLIENT_PORT);
          socket.open();
          TBinaryProtocol protocol = new TBinaryProtocol(socket);
          Cassandra.Client client = new Cassandra.Client(protocol);
          client.describe_cluster_name();
          socket.close();
          break;
View Full Code Here

  public void testInstances() throws Exception {
    Set<String> endPoints = new HashSet<String>();
    for (Instance instance : cluster.getInstances()) {
      TSocket socket = new TSocket(instance.getPublicAddress().getHostAddress(),
          CassandraService.CLIENT_PORT);
      socket.open();
      TBinaryProtocol protocol = new TBinaryProtocol(socket);
      Cassandra.Client client = new Cassandra.Client(protocol);
      List<TokenRange> tr = client.describe_ring(KEYSPACE);
      for (TokenRange tokenRange : tr) {
        endPoints.addAll(tokenRange.endpoints);
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.