Examples of TFramedTransport


Examples of org.apache.thrift.transport.TFramedTransport

     */
    @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.TFramedTransport

      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.TFramedTransport

    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.TFramedTransport

    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.TFramedTransport

    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

Examples of org.apache.thrift.transport.TFramedTransport

     * Connect to the specified server via framed transport
     * @param transport The underlying Thrift transport.
     */
    public TTransport connect(TTransport transport, String serverHost) throws TTransportException {
        //create a framed transport
        TTransport conn = new TFramedTransport(transport);

        //connect
        conn.open();
        LOG.debug("Simple client transport has been established");

        return conn;
    }
View Full Code Here

Examples of org.apache.thrift.transport.TFramedTransport

    if (client == null) {
      TTransport transport = new TSocket(host, port);
      ((TSocket) transport).setTimeout(10000);
      // wrap transport if framed transport is enabled
      if (isFramed) {
        transport = new TFramedTransport(transport);
      }
      TProtocol protocol = new TBinaryProtocol(transport);
      transport.open();
      client = new Client(protocol);
      th.set(client);
View Full Code Here

Examples of org.apache.thrift.transport.TFramedTransport

        if (transport != null)
            transport.close();

        if (sessionState.framed)
        {
            transport = new TFramedTransport(socket);
        }
        else
        {
            transport = socket;
        }
View Full Code Here

Examples of org.apache.thrift.transport.TFramedTransport

    }

    private static Cassandra.Client createConnection(String host, Integer port, boolean framed) throws IOException
    {
        TSocket socket = new TSocket(host, port);
        TTransport trans = framed ? new TFramedTransport(socket) : socket;
        try
        {
            trans.open();
        }
        catch (TTransportException e)
View Full Code Here

Examples of org.apache.thrift.transport.TFramedTransport

    {
        // random node selection for fake load balancing
        String currentNode = nodes[Stress.randomizer.nextInt(nodes.length)];

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

        try
        {
            transport.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.