Package org.apache.thrift.transport

Examples of org.apache.thrift.transport.TSocket


    return parseAddress(address.toString(), defaultPort);
  }
 
  static public TSocket createTSocket(String address, int defaultPort) {
    InetSocketAddress addr = parseAddress(address, defaultPort);
    return new TSocket(addr.getHostName(), addr.getPort());
  }
View Full Code Here


  public TestProxyClient(String host, int port) throws TTransportException {
    this(host, port, new TCompactProtocol.Factory());
  }
 
  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

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

    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();
View Full Code Here

    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();
View Full Code Here

    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();
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) {
View Full Code Here

    // or null, do not connect back.
    if (host != null && !"".equals(host)) {
      LOG.info("Assigning session id " + sessionId + " to connection to " + host + ":" + port);

      try {
        TTransport transport = new TFramedTransport(new TSocket(host, port));
        transport.open();
        TProtocol protocol = new TBinaryProtocol(transport);
        ClientConsole.Client client = new ClientConsole.Client(protocol);

        // Store the info about this RPC connection in the active sessions table.
View Full Code Here

TOP

Related Classes of org.apache.thrift.transport.TSocket

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.