Package org.elasticsearch.node

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


        Settings settings = ImmutableSettings.settingsBuilder()
                .put("name", shellSettings.settings().get(ShellSettings.NODE_NAME))
                .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!");
        }
View Full Code Here


    public ElasticSearchIndexProvider(final Properties properties) {
        type = System.getProperty(PROPERTY_TYPE, PROPERTY_TYPE_DEFAULT);
        final String clusterName = System.getProperty(PROPERTY_CLUSTER, PROPERTY_CLUSTER_DEFAULT);
        final Node node = NodeBuilder.nodeBuilder().loadConfigSettings(false).client(true).data(false).clusterName(clusterName).build();
        node.start();
        client = node.client();

        log.info(String.format("Instantiated index provider: %s (cluster.name=%s)",
                               getClass().getSimpleName(), clusterName));
    }
View Full Code Here

                .put("http.enabled", false)
                .put("index.store.type", "ram")
                .put("config.ignore_system_properties", true) // make sure we get what we set :)
                .put("gateway.type", "none")
                .build()).clusterName("foobar").build();
        node.start();
        try {
            TransportAddress transportAddress = ((InternalNode) node).injector().getInstance(TransportService.class).boundAddress().publishAddress();
            client.addTransportAddress(transportAddress);
            assertThat(nodeService.connectedNodes().size(), greaterThanOrEqualTo(1)); // since we force transport clients there has to be one node started that we connect to.
            for (DiscoveryNode discoveryNode : nodeService.connectedNodes()) {  // connected nodes have updated version
View Full Code Here

                .put("path.plugins", "src")
                .put("cluster.name", "test-cluster-" + NetworkUtils.getLocalAddress()))
                .local(false)
                .node();

        node.start();

        new CountDownLatch(1).await();
    }
}
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.