Package org.apache.thrift.transport

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


            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 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(HConstants.META_TABLE_NAME,
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 = new TSocket(host, port);
        TProtocol protocol = new TBinaryProtocol(transport, true, true);
        Hbase.Client client = new Hbase.Client(protocol);

        transport.open();

        byte[] t = bytes("demo_table");

        //
        // Scan all tables, look for the demo table and delete it.
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

   * @throws TTransportException Connection errors
   */
  public static ThriftHiveMetastore.Iface create(String host, int port,
    int timeoutMillis) throws TTransportException {
    TTransport transport = new TSocket(host, port, timeoutMillis);
    transport.open();
    TProtocol protocol = new TBinaryProtocol(transport);
    return new ThriftHiveMetastore.Client(protocol);
  }

  /**
 
View Full Code Here

        "client already initialized -- double init not allowed");
    int timeout = FlumeConfiguration.get().getThriftSocketTimeoutMs();
    TTransport masterTransport = new TSocket(masterHostname, masterPort, timeout);
    TProtocol protocol = new TBinaryProtocol(masterTransport);
    try {
      masterTransport.open();
    } catch (TTransportException e) {
      throw new IOException(e.getMessage());
    }
    masterClient = new Client(protocol);
    LOG.info("Connected to master at " + masterHostname + ":" + masterPort);
View Full Code Here

  private ThriftFlumeReportServer.Client connectReportClient(String host,
      int port) throws TTransportException {
    TTransport masterTransport = new TSocket(host, port);
    TProtocol protocol = new TBinaryProtocol(masterTransport);
    masterTransport.open();
    return new ThriftFlumeReportServer.Client(protocol);
  }

  protected void connect(String host, int aPort, int rPort) throws IOException,
      TTransportException {
View Full Code Here

  @Test
  public void testGetAllReports() throws TException {
    TTransport transport = new TSocket("localhost", PORT);
    TProtocol protocol = new TBinaryProtocol(transport);
    transport.open();

    ThriftFlumeReportServer.Client client = new ThriftFlumeReportServer.Client(
        protocol);
    Map<String, ThriftFlumeReport> ret = client.getAllReports();
    assertTrue(ret.size() == 1);
View Full Code Here

  @Test
  public void testGetReportByName() throws TException {
    TTransport transport = new TSocket("localhost", PORT);
    TProtocol protocol = new TBinaryProtocol(transport);
    transport.open();
    ThriftFlumeReportServer.Client client = new ThriftFlumeReportServer.Client(
        protocol);

    ThriftFlumeReport rep = client.getReportByName("reportable1");
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.