Package org.apache.thrift.transport

Examples of org.apache.thrift.transport.TFramedTransport$Factory


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

        if (css_.framed) {
            transport_ = new TFramedTransport(socket);
        } else {
            transport_ = socket;
        }

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


        }

        private static Cassandra.Client createThriftClient(String host, int port, String user, String passwd) throws Exception
        {
            TSocket socket = new TSocket(host, port);
            TTransport trans = new TFramedTransport(socket);
            trans.open();
            TProtocol protocol = new TBinaryProtocol(trans);
            Cassandra.Client client = new Cassandra.Client(protocol);
            if (user != null && passwd != null)
            {
                Map<String, String> credentials = new HashMap<String, String>();
View Full Code Here

  }
 
  public TestProxyClient(String host, int port, TProtocolFactory protoFactory) throws TTransportException {
    final TSocket socket = new TSocket(host, port);
    socket.setTimeout(600000);
    transport = new TFramedTransport(socket);
    final TProtocol protocol = protoFactory.getProtocol(transport);
    proxy = new AccumuloProxy.Client(protocol);
    transport.open();
  }
View Full Code Here

      throws IOException {
    // Connect to cluster manager thrift service
    String target = CoronaConf.getClusterManagerAddress(fConf);
    LOG.info("Connecting to Cluster Manager at " + target);
    InetSocketAddress address = NetUtils.createSocketAddr(target);
    transport = new TFramedTransport(
      new TSocket(address.getHostName(), address.getPort()));
    TProtocol protocol = new TBinaryProtocol(transport);
    client = new ClusterManagerService.Client(protocol);
    try {
      transport.open();
View Full Code Here

    // Get the current configuration
    CoronaConf conf = new CoronaConf(getConf());

    InetSocketAddress address = NetUtils.createSocketAddr(conf
        .getClusterManagerAddress());
    TFramedTransport transport = new TFramedTransport(
      new TSocket(address.getHostName(), address.getPort()));
    ClusterManagerService.Client client = new ClusterManagerService.Client(
        new TBinaryProtocol(transport));

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

    // Get the current configuration
    CoronaConf conf = new CoronaConf(getConf());

    InetSocketAddress address = NetUtils.createSocketAddr(conf
      .getClusterManagerAddress());
    TFramedTransport transport = new TFramedTransport(
      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

    // Get the current configuration
    CoronaConf conf = new CoronaConf(getConf());

    InetSocketAddress address = NetUtils.createSocketAddr(conf
      .getClusterManagerAddress());
    TFramedTransport transport = new TFramedTransport(
      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

     * Initialize the CM client
     * @throws TException
     */
    private void init() throws TException {
      if (transport == null) {
        transport = new TFramedTransport(new TSocket(host, port));
        client = new ClusterManagerService.Client(
            new TBinaryProtocol(transport));
        transport.open();
      }
    }
View Full Code Here

   */
  private static ClusterManagerService.Client getCMSClient(CoronaConf conf)
    throws TTransportException {
    InetSocketAddress address = NetUtils.createSocketAddr(conf
        .getClusterManagerAddress());
    TFramedTransport transport = new TFramedTransport(
      new TSocket(address.getHostName(), address.getPort()));
    ClusterManagerService.Client client = new ClusterManagerService.Client(
        new TBinaryProtocol(transport));
    transport.open();
    return client;
  }
View Full Code Here

   */
  public static CoronaProxyJobTrackerService.Client
    getPJTClient(CoronaConf conf) throws IOException {
    InetSocketAddress address =
      NetUtils.createSocketAddr(conf.getProxyJobTrackerThriftAddress());
    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

TOP

Related Classes of org.apache.thrift.transport.TFramedTransport$Factory

Copyright © 2018 www.massapicom. 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.