Package org.apache.thrift.transport

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


  public AdminRPCThrift(String masterHost, int masterPort) throws IOException {
    TTransport masterTransport = new TSocket(masterHost, masterPort);
    TProtocol protocol = new TBinaryProtocol(masterTransport);
    try {
      masterTransport.open();
    } catch (TTransportException e) {
      throw new IOException(e);
    }
    masterClient = new Client(protocol);
    LOG.info("Connected to master at " + masterHost + ":" + masterPort);
View Full Code Here


        .getScribeSourcePort());
    // scribe clients used framed transports
    transport = new TFramedTransport(transport);
    // scribe clients do not use strict write
    TProtocol protocol = new TBinaryProtocol(transport, false, false);
    transport.open();
    scribe.Client client = new scribe.Client(protocol);

    // Note - there is a tiny possibility of a race here, which is why we retry
    for (int i = 0; i < 3; ++i) {
      if (client.getStatus() != fb_status.ALIVE) {
View Full Code Here

    // Open the client connection
    TTransport transport = new TSocket("localhost", 45872);
    transport = new TFramedTransport(transport);
    // scribe clients do not use strict write
    TProtocol protocol = new TBinaryProtocol(transport, false, false);
    transport.open();
    scribe.Client client = new scribe.Client(protocol);

    // Note - there is a tiny possibility of a race here, which is why we retry
    for (int i = 0; i < 3; ++i) {
      if (client.getStatus() != fb_status.ALIVE) {
View Full Code Here

  public static NodeMonitorService.Client createBlockingNmClient(String host, int port,
      int timeout)
      throws IOException {
    TTransport tr = new TFramedTransport(new TSocket(host, port, timeout));
    try {
      tr.open();
    } catch (TTransportException e) {
      LOG.warn("Error creating node monitor client to " + host + ":" + port);
      throw new IOException(e);
    }
    TProtocol proto = new TBinaryProtocol(tr);
View Full Code Here

  public static SchedulerService.Client createBlockingSchedulerClient(
      String host, int port, int timeout) throws IOException {
    TTransport tr = new TFramedTransport(new TSocket(host, port, timeout));
    try {
      tr.open();
    } catch (TTransportException e) {
      LOG.warn("Error creating scheduler client to " + host + ":" + port);
      throw new IOException(e);
    }
    TProtocol proto = new TBinaryProtocol(tr);
View Full Code Here

  public static GetTaskService.Client createBlockingGetTaskClient(
      String host, int port, int timeout) throws IOException {
    TTransport tr = new TFramedTransport(new TSocket(host, port, timeout));
    try {
      tr.open();
    } catch (TTransportException e) {
      LOG.warn("Error creating scheduler client to " + host + ":" + port);
      throw new IOException(e);
    }
    TProtocol proto = new TBinaryProtocol(tr);
View Full Code Here

  public static BackendService.Client createBlockingBackendClient(
      String host, int port) throws IOException {
    TTransport tr = new TFramedTransport(new TSocket(host, port));
    try {
      tr.open();
    } catch (TTransportException e) {
      LOG.warn("Error creating backend client to " + host + ":" + port);
      throw new IOException(e);
    }
    TProtocol proto = new TBinaryProtocol(tr);
View Full Code Here

  public static StateStoreService.Client createBlockingStateStoreClient(
      String host, int port) throws IOException {
    TTransport tr = new TFramedTransport(new TSocket(host, port));
    try {
      tr.open();
    } catch (TTransportException e) {
      LOG.warn("Error creating state store client to " + host + ":" + port);
      throw new IOException(e);
    }
    TProtocol proto = new TBinaryProtocol(tr);
View Full Code Here

  public static FrontendService.Client createBlockingFrontendClient(
      String host, int port) throws IOException {
    TTransport tr = new TFramedTransport(new TSocket(host, port));
    try {
      tr.open();
    } catch (TTransportException e) {
      LOG.warn("Error creating state store client to " + host + ":" + port);
      throw new IOException(e);
    }
    TProtocol proto = new TBinaryProtocol(tr);
View Full Code Here

  }

  private static void pongUsingSynchronousClient(String hostname)
      throws TException, InterruptedException {
    TTransport tr = new TFramedTransport(new TSocket(hostname, 12345));
    tr.open();
    TProtocol proto = new TBinaryProtocol(tr);
    PongService.Client client = new PongService.Client(proto);
    while (true) {
      Long t = System.nanoTime();
      client.ping("PING");
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.