Package org.apache.blur.thrift

Examples of org.apache.blur.thrift.Connection


    int controllerPort = localConf.getInt(BLUR_CONTROLLER_BIND_PORT, 40010);
    for (int i = 0; i < num; i++) {
      try {
        ThriftServer server = ThriftBlurControllerServer.createServer(i, localConf);
        controllers.add(server);
        Connection connection = new Connection("localhost", controllerPort + i);
        if (builder.length() != 0) {
          builder.append(',');
        }
        builder.append(connection.getConnectionStr());
        startServer(server, connection);
      } catch (Exception e) {
        LOG.error(e);
        throw new RuntimeException(e);
      }
View Full Code Here


    int shardPort = localConf.getInt(BLUR_SHARD_BIND_PORT, 40020);
    for (int i = 0; i < num; i++) {
      try {
        ThriftServer server = futures.get(i).get();
        shards.add(server);
        Connection connection = new Connection("localhost", shardPort + i);
        startServer(server, connection);
      } catch (Exception e) {
        LOG.error(e);
        throw new RuntimeException(e);
      }
View Full Code Here

public class PrintConfiguration {

  public static void main(String[] args) throws BlurException, TException, IOException {
    String connectionStr = args[0];
    Iface client = BlurClient.getClient(new Connection("localhost", 40020,10000));
    Map<String, String> map = new TreeMap<String, String>(client.configuration());
    for (Entry<String, String> e : map.entrySet()) {
      System.out.println(e.getKey() + " " + e.getValue());
    }
  }
View Full Code Here

    return shardClients;
  }

  private boolean tryToConnect(String sc, AtomicReference<Client> ref) {
    try {
      Client c = BlurClientManager.newClient(new Connection(sc));
      ref.set(c);
      return true;
    } catch (TTransportException e) {
      ref.set(null);
      if (Main.debug) {
View Full Code Here

      String arg0 = args[0];
      Command command = commands.get(arg0);
      if (command == null) {
        // then might be controller string
        try {
          new Connection(arg0);
        } catch (RuntimeException e) {
          String message = e.getMessage();
          System.err.println("Arg [" + arg0 + "] could not be located as a command and is not a connection string. ["
              + message + "]");
          return null;
View Full Code Here

    return shardClients;
  }

  private boolean tryToConnect(String sc, AtomicReference<Client> ref) {
    try {
      Client c = BlurClientManager.newClient(new Connection(sc));
      ref.set(c);
      return true;
    } catch (TTransportException e) {
      ref.set(null);
      if (Main.debug) {
View Full Code Here

      String arg0 = args[0];
      Command command = commands.get(arg0);
      if (command == null) {
        // then might be controller string
        try {
          new Connection(arg0);
        } catch (RuntimeException e) {
          String message = e.getMessage();
          System.err.println("Arg [" + arg0 + "] could not be located as a command and is not a connection string. ["
              + message + "]");
          return null;
View Full Code Here

TOP

Related Classes of org.apache.blur.thrift.Connection

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.