Examples of TransportClient


Examples of org.elasticsearch.client.transport.TransportClient

            public void run() {
                nodeBuilder().client(true).node().close();
            }
        });

        final Client client = new TransportClient()
                .addTransportAddress(new InetSocketTransportAddress(
                        config.getString("restopengov.elasticsearch-host"),
                        config.getInt("restopengov.elasticsearch-port")));

View Full Code Here

Examples of org.elasticsearch.client.transport.TransportClient

      final Node node = nb.node();
      client = node.client();

    } else {
      Logger.info("Connecting Play! to Elastic Search in Client Mode");
      final TransportClient c = new TransportClient(settings);
      if (Play.configuration.getProperty("elasticsearch.client") == null) {
        throw new RuntimeException("Configuration required - elasticsearch.client when local model is disabled!");
      }
      final String[] hosts = getHosts().trim().split(",");
      boolean done = false;
      for (final String host : hosts) {
        final String[] parts = host.split(":");
        if (parts.length != 2) {
          throw new RuntimeException("Invalid Host: " + host);
        }
        Logger.info("Transport Client - Host: %s Port: %s", parts[0], parts[1]);
        if (Integer.valueOf(parts[1]) == 9200)
          Logger.info("Note: Port 9200 is usually used by the HTTP Transport. You might want to use 9300 instead.");
        c.addTransportAddress(new InetSocketTransportAddress(parts[0], Integer.valueOf(parts[1])));
        done = true;
      }
      if (done == false) {
        throw new RuntimeException("No Hosts Provided for Elastic Search!");
      }
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.