Package org.apache.thrift.transport

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


        private static Cassandra.Client createThriftClient(String host, int port) throws TTransportException
        {
            TSocket socket = new TSocket(host, port);
            TTransport trans = new TFramedTransport(socket);
            trans.open();
            TProtocol protocol = new TBinaryProtocol(trans);
            return new Cassandra.Client(protocol);
        }
    }
View Full Code Here


  private Cassandra.Client client(Instance instance) throws TException {
    TTransport trans = new TFramedTransport(new TSocket(
        instance.getPublicIp(),
        CassandraClusterActionHandler.CLIENT_PORT));
    trans.open();
    TBinaryProtocol protocol = new TBinaryProtocol(trans);
    return new Cassandra.Client(protocol);
  }

  private void waitForCassandra() {
View Full Code Here

    protected static Cassandra.Client getClient() throws TTransportException
    {
        TTransport tr = new TFramedTransport(new TSocket("localhost", 9170));
        TProtocol proto = new TBinaryProtocol(tr);
        Cassandra.Client client = new Cassandra.Client(proto);
        tr.open();
        return client;
    }

    protected static void startCassandra() throws IOException
    {
View Full Code Here

    InetSocketAddress address = NetUtils.createSocketAddr(target);
    TTransport transport = new TFramedTransport(
      new TSocket(address.getHostName(), address.getPort()));
    TProtocol protocol = new TBinaryProtocol(transport);
    ClusterManagerService.Client client = new ClusterManagerService.Client(protocol);
    transport.open();
    LOG.info("Requesting running session info for handle: " + sessionHandle);
    SessionInfo info = client.getSessionInfo(sessionHandle);
    transport.close();
    return info;
  }
View Full Code Here

    InstanceService.Iface CreateRpcClient() {
        TSocket socket = new TSocket(rpc_address.getHostAddress(), rpc_port);
        TTransport transport = new TFramedTransport(socket);
        try {
            transport.open();
        } catch (TTransportException tte) {
            s_logger.error(rpc_address + ":" + rpc_port +
                    " Create TTransportException: " + tte.getMessage());
            return null;
        }
View Full Code Here

    TFramedTransport transport = new TFramedTransport(
      new TSocket(address.getHostName(), address.getPort()));
    CoronaProxyJobTrackerService.Client client =
      new CoronaProxyJobTrackerService.Client(new TBinaryProtocol(transport));
    try {
      transport.open();
    } catch (TException e) {
      LOG.info("Transport Exception: ", e);
    }
    return client;
  }
View Full Code Here

      new TSocket(address.getHostName(), address.getPort()));
    ClusterManagerService.Client client = new ClusterManagerService.Client(
        new TBinaryProtocol(transport));

    try {
      transport.open();
      client.refreshNodes();
    } catch (SafeModeException e) {
      System.err.println("ClusterManager is in Safe Mode");
    } catch (TException e) {
      throw new IOException(e);
View Full Code Here

        new TBinaryProtocol(transport));
    int restartBatch = (batchSize > 0) ? batchSize :
      conf.getCoronaNodeRestartBatch();

    try {
      transport.open();
      RestartNodesArgs restartNodeArgs = new RestartNodesArgs(
        forceFlag, restartBatch);
      client.restartNodes(restartNodeArgs);
    } catch (SafeModeException e) {
      System.err.println("ClusterManager is in Safe Mode");
View Full Code Here

      new TSocket(address.getHostName(), address.getPort()));
    ClusterManagerService.Client client = new ClusterManagerService.Client(
      new TBinaryProtocol(transport));

    try {
      transport.open();
      if (client.setSafeMode(safeMode)) {
        System.out.println("The safeMode is: " +
                            (safeMode ? "ON" : "OFF"));
      } else {
        System.err.println("Could not set the safeMode flag");
View Full Code Here

      new TSocket(address.getHostName(), address.getPort()));
    ClusterManagerService.Client client = new ClusterManagerService.Client(
      new TBinaryProtocol(transport));

    try {
      transport.open();
      if (!client.persistState())  {
        System.err.println("Persisting Cluster Manager state failed. ");
      }
    } catch (TException e) {
      throw new IOException(e);
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.