Examples of TSocket


Examples of org.apache.thrift.transport.TSocket

    tx.close();
  }

  @Test
  public void testScribeMultipleMessages() throws Exception {
    TTransport transport = new TFramedTransport(new TSocket("localhost", port));

    TProtocol protocol = new TBinaryProtocol(transport);
    Scribe.Client client = new Scribe.Client(protocol);
    transport.open();
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

  public boolean isSingleton() {
    return true;
  }

  protected HiveClient createHiveClient() {
    TSocket transport = new TSocket(host, port, timeout);
    HiveClient hive = new HiveClient(new TBinaryProtocol(transport));

    try {
      transport.open();

      if (!CollectionUtils.isEmpty(scripts)) {
        HiveUtils.runWithConversion(hive, scripts, false);
      }
    } catch (TTransportException ex) {
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

  private Classifier.Client client;
  private TTransport transport;
  private static final int SECONDS = 1000;

  public Connection(String host, int port) throws TTransportException {
    TSocket socket = new TSocket(host, port);
    socket.setTimeout(10 * SECONDS);
    TProtocol protocol = new TBinaryProtocol(socket);

    client = new Classifier.Client(protocol);
    this.transport = socket;
    this.transport.open();
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

  //  Stress the server using the thrift API
 
  public Cassandra.Client connect() {
    int port = 9160;
    TSocket socket = new TSocket(server_, port);
    if(transport_ != null)
      transport_.close();
    transport_ = socket;

    TBinaryProtocol binaryProtocol = new TBinaryProtocol(transport_, false,
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

    /**
     * {@inheritDoc}
     */
    @Override
    public void setup() throws TException {
        final TSocket socket = new TSocket(host, port);
        socket.setTimeout(timeout);
        transport = new TFramedTransport(socket);
        final TProtocol protocol = new TBinaryProtocol(transport);
        client = new ZipkinCollector.Client(protocol);
        transport.open();
    }
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

    tr.close();

  }

  public boolean isCassandraUp() {
    tr = new TFramedTransport(new TSocket(cassandraHost, cassandraPort));
    try {

      tr.open();
      if (tr.isOpen()) {
        return true;
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

      String replicationFactor) throws Exception {

    List<CfDef> cfDefList = new ArrayList<CfDef>();
    KsDef ksDef = new KsDef(keyspace, locatorStrategy, cfDefList);
    ksDef.putToStrategy_options("replication_factor", replicationFactor);
    tr = new TFramedTransport(new TSocket(cassandraHost, cassandraPort));
    proto = new TBinaryProtocol(tr);
    client = new Cassandra.Client(proto);

    tr.open();
    client.system_add_keyspace(ksDef);
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

    CfDef columnFamily = new CfDef(keyspace, columnFamilyName);
    columnFamily.setKey_validation_class(keyValidationClass);
    columnFamily.setComparator_type(comparatorType);
    columnFamily.setDefault_validation_class(defaultValidationClass);

    tr = new TFramedTransport(new TSocket(cassandraHost, cassandraPort));
    proto = new TBinaryProtocol(tr);
    client = new Cassandra.Client(proto);

    tr.open();
    client.set_keyspace(keyspace);
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

            TTransport trans = inProt.getTransport();
            //Sasl transport
            TSaslServerTransport saslTrans = (TSaslServerTransport)trans;

            //remote address
            TSocket tsocket = (TSocket)saslTrans.getUnderlyingTransport();
            Socket socket = tsocket.getSocket();
            req_context.setRemoteAddress(socket.getInetAddress());

            //remote subject
            SaslServer saslServer = saslTrans.getSaslServer();
            String authId = saslServer.getAuthorizationID();
View Full Code Here

Examples of org.apache.thrift.transport.TSocket

    public DRPCClient(String host, int port) {
        this(host, port, null);
    }
   
    private void connect() throws TException {
        TSocket socket = new TSocket(host, port);
        if(timeout!=null) {
            socket.setTimeout(timeout);
        }
        conn = new TFramedTransport(socket);
        client = new DistributedRPC.Client(new TBinaryProtocol(conn));
        conn.open();
    }
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.