Package org.elasticsearch.node

Examples of org.elasticsearch.node.Node


    // 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


    if (finalSettings.get("cluster.routing.schedule") != null) {
      // decrease the routing schedule so new nodes will be added quickly
      finalSettings = settingsBuilder().put(finalSettings).put("cluster.routing.schedule", "50ms").build();
    }

    Node node = nodeBuilder()
          .settings(finalSettings)
          .build();
    nodes.put(id, node);
   
//    ImmutableSettings.Builder elasticsearchSettings = ImmutableSettings.settingsBuilder()
//        .put("path.data", ES_DATA_DIR);
   
    clients.put(id, node.client());
    return node;
  }
View Full Code Here

  public void closeNode(String id) {
    Client client = clients.remove(id);
    if (client != null) {
      client.close();
    }
    Node node = nodes.remove(id);
    if (node != null) {
      node.close();
    }
  }
View Full Code Here

        } else if(clientType == ClientType.NODE) {
            log.info("Create a nodeClient, allows transport clients to connect");
            nodeBuilder = nodeBuilder.local(false);
        }

        Node node = nodeBuilder.node();
        log.info("Got node");
        client = node.client();
        log.info("Created new node client");
        return client;
    }
View Full Code Here

        if (finalSettings.get("cluster.routing.schedule") != null) {
            // decrease the routing schedule so new nodes will be added quickly
            finalSettings = settingsBuilder().put(finalSettings).put("cluster.routing.schedule", "50ms").build();
        }

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

    public void closeNode(String id) {
        Client client = clients.remove(id);
        if (client != null) {
            client.close();
        }
        Node node = nodes.remove(id);
        if (node != null) {
            node.close();
        }
    }
View Full Code Here

        if (finalSettings.get("gateway.type") == null) {
            // default to non gateway
            finalSettings = settingsBuilder().put(finalSettings).put("gateway.type", "none").build();
        }

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

    public void closeNode(String id) {
        Client client = clients.remove(id);
        if (client != null) {
            client.close();
        }
        Node node = nodes.remove(id);
        if (node != null) {
            node.close();
        }
    }
View Full Code Here

                dataLoader.load(new ClassPathJsonDataSet("dataset/dataset.json"));

                final ImmutableSettings.Builder builder = ImmutableSettings.settingsBuilder();
                builder.put("cluster.name", clusterName);

                final Node node = NodeBuilder.nodeBuilder().settings(builder.build()).local(true).node();
                client = node.client();

                isInitialized = true;
            }
        }
    }
View Full Code Here

        // Disable multicast discovery
        .put("discovery.zen.ping.multicast.enabled", false)
        // Add one or more host to join
        .putArray("discovery.zen.ping.unicast.hosts", hosts.split(","))
        .build();
    Node node = NodeBuilder.nodeBuilder()
        .settings(settings)
        .node();
    return node.client();
  }
View Full Code Here

TOP

Related Classes of org.elasticsearch.node.Node

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.