Package org.elasticsearch.node

Examples of org.elasticsearch.node.Node.client()


    public static void main(String[] args) throws Exception {

        Node node = NodeBuilder.nodeBuilder().settings(ImmutableSettings.settingsBuilder().put("gateway.type", "none")).node();

        node.client().prepareIndex("_river", "test1", "_meta").setSource(jsonBuilder().startObject().field("type", "rabbitmq").endObject()).execute().actionGet();

        ConnectionFactory cfconn = new ConnectionFactory();
        cfconn.setHost("localhost");
        cfconn.setPort(AMQP.PROTOCOL.PORT);
        Connection conn = cfconn.newConnection();
View Full Code Here


    nodes.put(id, node);
   
//    ImmutableSettings.Builder elasticsearchSettings = ImmutableSettings.settingsBuilder()
//        .put("path.data", ES_DATA_DIR);
   
    clients.put(id, node.client());
    return node;
  }

  public void closeNode(String id) {
    Client client = clients.remove(id);
View Full Code Here

    nodes.put(id, node);
   
//    ImmutableSettings.Builder elasticsearchSettings = ImmutableSettings.settingsBuilder()
//        .put("path.data", ES_DATA_DIR);
   
    clients.put(id, node.client());
    return node;
  }

  public void closeNode(String id) {
    Client client = clients.remove(id);
View Full Code Here

                .put("http.enabled", false)
                .build();
        Node node  = NodeBuilder.nodeBuilder().clusterName(clusterName).client(true).settings(settings).build();
        node.start();
        //unfortunately the es clients are not type safe, need to cast it
        Client client = node.client();
        if (! (client instanceof org.elasticsearch.client.node.NodeClient) ) {
            throw new RuntimeException("Unable to create node client: the returned node isn't a NodeClient!");
        }
        org.elasticsearch.client.node.NodeClient nodeClient = (org.elasticsearch.client.node.NodeClient)client;
        //if clusterKo we immediately close both the client and the node that we just created
View Full Code Here

        Node node = nodeBuilder()
                .settings(finalSettings)
                .build();
        nodes.put(id, node);
        clients.put(id, node.client());
        return node;
    }

    public void closeNode(String id) {
        Client client = clients.remove(id);
View Full Code Here

        Node node = nodeBuilder()
                .settings(finalSettings)
                .build();
        nodes.put(id, node);
        clients.put(id, node.client());
        return node;
    }

    public void closeNode(String id) {
        Client client = clients.remove(id);
View Full Code Here

                .put("name", id)
                .put("gateway.type", "none")
                .put("cluster.routing.schedule", "50ms")
                .build();
        Node node = nodeBuilder().settings(finalSettings).build();
        Client client = node.client();
        nodes.put(id, node);
        clients.put(id, client);
        return node;
    }
View Full Code Here

    // Check Model
    if (this.isLocalMode()) {
      Logger.info("Starting Elastic Search for Play! in Local Mode");
      final NodeBuilder nb = nodeBuilder().settings(settings).local(true).client(false).data(true);
      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) {
View Full Code Here

    nodes.put(id, node);
   
//    ImmutableSettings.Builder elasticsearchSettings = ImmutableSettings.settingsBuilder()
//        .put("path.data", ES_DATA_DIR);
   
    clients.put(id, node.client());
    return node;
  }

  public void closeNode(String id) {
    Client client = clients.remove(id);
View Full Code Here

            nodeBuilder = nodeBuilder.local(false);
        }

        Node node = nodeBuilder.node();
        log.info("Got node");
        client = node.client();
        log.info("Created new node client");
        return client;
    }
   
    public String getConfigurationStringWithFallBack(String module, String configurationKey, String defaultFallbackValue) {
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.