Package org.elasticsearch.action.admin.cluster.health

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.timedOut()


        for (int i = 0; i < 100; i++) {
            int index = i % nodes.length;
            nodes[index].close();

            ClusterHealthResponse health = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
            if (health.timedOut()) {
                System.err.println("timed out on health");
            }

            nodes[index] = NodeBuilder.nodeBuilder().node();
View Full Code Here


            }

            nodes[index] = NodeBuilder.nodeBuilder().node();

            health = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
            if (health.timedOut()) {
                System.err.println("timed out on health");
            }
        }

        latch.await();
View Full Code Here

            }
            System.out.println("--> Indexing took " + stopWatch.totalTime() + ", TPS " + (((double) (COUNT * (1 + CHILD_COUNT))) / stopWatch.totalTime().secondsFrac()));
        } catch (Exception e) {
            System.out.println("--> Index already exists, ignoring indexing phase, waiting for green");
            ClusterHealthResponse clusterHealthResponse = client.admin().cluster().prepareHealth().setWaitForGreenStatus().setTimeout("10m").execute().actionGet();
            if (clusterHealthResponse.timedOut()) {
                System.err.println("--> Timed out waiting for cluster health");
            }
        }
        client.admin().indices().prepareRefresh().execute().actionGet();
        System.out.println("--> Number of docs in index: " + client.prepareCount().setQuery(matchAllQuery()).execute().actionGet().count());
View Full Code Here

                ClusterHealthResponse clusterHealth = client.client().admin().cluster().prepareHealth()
                        .setWaitForGreenStatus()
                        .setWaitForNodes(Integer.toString(numberOfNodes + 0 /* client node*/))
                        .setWaitForRelocatingShards(0)
                        .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

                ClusterHealthResponse clusterHealth = client.client().admin().cluster().prepareHealth()
                        .setWaitForGreenStatus()
                        .setWaitForNodes(Integer.toString(numberOfNodes + 1 /* client node*/))
                        .setWaitForRelocatingShards(0)
                        .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

        ClusterHealthResponse health = node.client().admin().cluster().prepareHealth().setTimeout("5m").setWaitForYellowStatus().execute().actionGet();
        logger.info("health: " + health.status());
        logger.info("active shards: " + health.activeShards());
        logger.info("active primary shards: " + health.activePrimaryShards());
        if (health.timedOut()) {
            logger.error("Timed out on health...");
        }

        ClusterState clusterState = node.client().admin().cluster().prepareState().execute().actionGet().state();
        for (int i = 0; i < numberOfIndices; i++) {
View Full Code Here

            }

            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

        assertThat(createIndexResponse.acknowledged(), equalTo(true));

        logger.info("Running Cluster Health");
        ClusterHealthResponse clusterHealth = client("server1").admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();
        logger.info("Done Cluster Health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.YELLOW));

        // sleep till the cluster state gets published, since we check the master
        Thread.sleep(200);
View Full Code Here

        ClusterService clusterService2 = ((InternalNode) node("server2")).injector().getInstance(ClusterService.class);

        logger.info("Running Cluster Health");
        clusterHealth = client("server1").admin().cluster().health(clusterHealthRequest().waitForGreenStatus().waitForNodes("2")).actionGet();
        logger.info("Done Cluster Health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));

        // sleep till the cluster state gets published, since we check the master
        Thread.sleep(200);
View Full Code Here

        ClusterService clusterService3 = ((InternalNode) node("server3")).injector().getInstance(ClusterService.class);

        logger.info("Running Cluster Health");
        clusterHealth = client("server1").admin().cluster().health(clusterHealthRequest().waitForGreenStatus().waitForNodes("3").waitForRelocatingShards(0)).actionGet();
        logger.info("Done Cluster Health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
        assertThat(clusterHealth.relocatingShards(), equalTo(0));
        assertThat(clusterHealth.activeShards(), equalTo(22));
        assertThat(clusterHealth.activePrimaryShards(), equalTo(11));
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.