Package org.apache.thrift.transport

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


        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


    private static Cassandra.Client createConnection(String host, Integer port, boolean framed) throws TTransportException
    {
        TSocket socket = new TSocket(host, port);
        TTransport trans = framed ? new TFramedTransport(socket) : socket;
        trans.open();
        TProtocol protocol = new TBinaryProtocol(trans);

        return new Cassandra.Client(protocol);
    }
}
View Full Code Here

        TTransport transport = (isUnframed()) ? socket : new TFramedTransport(socket);
        Cassandra.Client client = new Cassandra.Client(new TBinaryProtocol(transport));

        try
        {
            transport.open();

            if (setKeyspace)
            {
                client.set_keyspace("Keyspace1");
            }
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

      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();
      } catch (TTransportException e) {
        e.printStackTrace();
      } catch (TException e) {
View Full Code Here

        CassandraClient client = new CassandraClient(new TBinaryProtocol(transport));

        try
        {
            if(!transport.isOpen())
                transport.open();

            if (enable_cql)
                client.set_cql_version(cqlVersion);

            if (setKeyspace)
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.