Examples of client()


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

            Node client = NodeBuilder.nodeBuilder().settings(settings).client(true).node();

            // verify that the indices are there
            for (int i = 0; i < numberOfIndices; i++) {
                try {
                    client.client().admin().indices().prepareCreate("test" + i).execute().actionGet();
                } catch (Exception e) {
                    // might already exists, fine
                }
            }
View Full Code Here

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

                }
            }

            logger.info("*** Waiting for GREEN status");
            try {
                ClusterHealthResponse clusterHealth = client.client().admin().cluster().prepareHealth().setWaitForGreenStatus().setTimeout("10m").execute().actionGet();
                if (clusterHealth.timedOut()) {
                    logger.warn("timed out waiting for green status....");
                }
            } catch (Exception e) {
                logger.warn("failed to execute cluster health....");
View Full Code Here

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

                }
            } catch (Exception e) {
                logger.warn("failed to execute cluster health....");
            }

            CountResponse count = client.client().prepareCount().setQuery(matchAllQuery()).execute().actionGet();
            logger.info("*** index_count [{}], expected_count [{}]", count.count(), indexCounter.get());
            // verify count
            for (int i = 0; i < (nodes.length * 5); i++) {
                count = client.client().prepareCount().setQuery(matchAllQuery()).execute().actionGet();
                logger.debug("index_count [{}], expected_count [{}]", count.count(), indexCounter.get());
View Full Code Here

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

            CountResponse count = client.client().prepareCount().setQuery(matchAllQuery()).execute().actionGet();
            logger.info("*** index_count [{}], expected_count [{}]", count.count(), indexCounter.get());
            // verify count
            for (int i = 0; i < (nodes.length * 5); i++) {
                count = client.client().prepareCount().setQuery(matchAllQuery()).execute().actionGet();
                logger.debug("index_count [{}], expected_count [{}]", count.count(), indexCounter.get());
                if (count.count() != indexCounter.get()) {
                    logger.warn("!!! count does not match, index_count [{}], expected_count [{}]", count.count(), indexCounter.get());
                    throw new Exception("failed test, count does not match...");
                }
View Full Code Here

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

            }

            // verify search
            for (int i = 0; i < (nodes.length * 5); i++) {
                // do a search with norms field, so we don't rely on match all filtering cache
                SearchResponse search = client.client().prepareSearch().setQuery(matchAllQuery().normsField("field")).execute().actionGet();
                logger.debug("index_count [{}], expected_count [{}]", search.hits().totalHits(), indexCounter.get());
                if (count.count() != indexCounter.get()) {
                    logger.warn("!!! search does not match, index_count [{}], expected_count [{}]", search.hits().totalHits(), indexCounter.get());
                    throw new Exception("failed test, count does not match...");
                }
View Full Code Here

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

            logger.info("*** ROUND {}", ++numberOfRounds);
            // bulk index data
            int numberOfBulks = numberOfDocsPerRound / bulkSize;
            for (int b = 0; b < numberOfBulks; b++) {
                BulkRequestBuilder bulk = client.client().prepareBulk();
                for (int k = 0; k < bulkSize; k++) {
                    StringBuffer sb = new StringBuffer();
                    XContentBuilder json = XContentFactory.jsonBuilder().startObject()
                            .field("field", "value" + ThreadLocalRandom.current().nextInt());

View Full Code Here

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

                    indexCounter.incrementAndGet();
                }
                bulk.execute().actionGet();
            }

            client.client().admin().indices().prepareGatewaySnapshot().execute().actionGet();

            client.close();
            for (Node node : nodes) {
                File nodeWork = ((InternalNode) node).injector().getInstance(NodeEnvironment.class).nodeDataLocation();
                node.close();
View Full Code Here

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

        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

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

        Client client;
        if (false) {
            client = NodeBuilder.nodeBuilder().client(true).node().client();
        } else {
            client = node.client();
        }

        client.prepareIndex("test", "type1", "1").setSource("field1", "value1").execute().actionGet();

        StopWatch stopWatch = new StopWatch().start();
View Full Code Here

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

     */
    @Test public void searchWhileCreatingIndex() {
        Node node = startNode("node1");

        try {
            node.client().admin().indices().prepareDelete("test").execute().actionGet();
        } catch (Exception e) {
            // ignore
        }

        for (int i = 0; i < 20; i++) {
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.