Examples of successfulShards()


Examples of org.elasticsearch.action.admin.cluster.ping.broadcast.BroadcastPingResponse.successfulShards()

        logger.info("Pinging single person with id 1");
        SinglePingResponse singleResponse = client("server1").admin().cluster().ping(pingSingleRequest("test1").type("person").id("1")).actionGet();

        logger.info("Broadcast pinging test1 and test2");
        BroadcastPingResponse broadcastResponse = client("server1").admin().cluster().ping(pingBroadcastRequest("test1", "test2")).actionGet();
        assertThat(broadcastResponse.successfulShards(), equalTo(10));
        assertThat(broadcastResponse.failedShards(), equalTo(0));

        logger.info("Broadcast pinging test1");
        broadcastResponse = client("server1").admin().cluster().ping(pingBroadcastRequest("test1")).actionGet();
        assertThat(broadcastResponse.successfulShards(), equalTo(5));
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.ping.broadcast.BroadcastPingResponse.successfulShards()

        assertThat(broadcastResponse.successfulShards(), equalTo(10));
        assertThat(broadcastResponse.failedShards(), equalTo(0));

        logger.info("Broadcast pinging test1");
        broadcastResponse = client("server1").admin().cluster().ping(pingBroadcastRequest("test1")).actionGet();
        assertThat(broadcastResponse.successfulShards(), equalTo(5));
        assertThat(broadcastResponse.failedShards(), equalTo(0));

        logger.info("Replication pinging test1 and test2");
        ReplicationPingResponse replicationResponse = client("server1").admin().cluster().ping(pingReplicationRequest("test1", "test2")).actionGet();
        assertThat(replicationResponse.indices().size(), equalTo(2));
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheResponse.successfulShards()

        indicesExistsResponse = client1.admin().indices().prepareExists("test1234565").execute().actionGet();
        assertThat(indicesExistsResponse.exists(), equalTo(false));

        logger.info("Clearing cache");
        ClearIndicesCacheResponse clearIndicesCacheResponse = client1.admin().indices().clearCache(clearIndicesCacheRequest("test")).actionGet();
        assertThat(clearIndicesCacheResponse.successfulShards(), equalTo(10));
        assertThat(clearIndicesCacheResponse.failedShards(), equalTo(0));

        logger.info("Optimizing");
        OptimizeResponse optimizeResponse = client1.admin().indices().prepareOptimize("test").execute().actionGet();
        assertThat(optimizeResponse.successfulShards(), equalTo(10));
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.flush.FlushResponse.successfulShards()

        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.YELLOW));

        client("server1").index(indexRequest("test").type("type1").id("1").source(source("1", "test"))).actionGet();
        FlushResponse flushResponse = client("server1").admin().indices().flush(flushRequest("test")).actionGet();
        assertThat(flushResponse.totalShards(), equalTo(10));
        assertThat(flushResponse.successfulShards(), equalTo(5));
        assertThat(flushResponse.failedShards(), equalTo(0));
        client("server1").index(indexRequest("test").type("type1").id("2").source(source("2", "test"))).actionGet();
        RefreshResponse refreshResponse = client("server1").admin().indices().refresh(refreshRequest("test")).actionGet();
        assertThat(refreshResponse.totalShards(), equalTo(10));
        assertThat(refreshResponse.successfulShards(), equalTo(5));
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.flush.FlushResponse.successfulShards()

        logger.info("Index [type1/2]");
        client1.index(indexRequest("test").type("type1").id("2").source(source("2", "test2"))).actionGet();

        logger.info("Flushing");
        FlushResponse flushResult = client1.admin().indices().prepareFlush("test").execute().actionGet();
        assertThat(flushResult.successfulShards(), equalTo(10));
        assertThat(flushResult.failedShards(), equalTo(0));
        logger.info("Refreshing");
        client1.admin().indices().refresh(refreshRequest("test")).actionGet();

        logger.info("Get [type1/1] and [type1/2]");
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.flush.FlushResponse.successfulShards()

        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.YELLOW));

        client("server1").index(indexRequest("test").type("type1").id("1").source(source("1", "test"))).actionGet();
        FlushResponse flushResponse = client("server1").admin().indices().flush(flushRequest("test")).actionGet();
        assertThat(flushResponse.totalShards(), equalTo(10));
        assertThat(flushResponse.successfulShards(), equalTo(5));
        assertThat(flushResponse.failedShards(), equalTo(0));
        client("server1").index(indexRequest("test").type("type1").id("2").source(source("2", "test"))).actionGet();
        RefreshResponse refreshResponse = client("server1").admin().indices().refresh(refreshRequest("test")).actionGet();
        assertThat(refreshResponse.totalShards(), equalTo(10));
        assertThat(refreshResponse.successfulShards(), equalTo(5));
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.optimize.OptimizeResponse.successfulShards()

        assertThat(clearIndicesCacheResponse.successfulShards(), equalTo(10));
        assertThat(clearIndicesCacheResponse.failedShards(), equalTo(0));

        logger.info("Optimizing");
        OptimizeResponse optimizeResponse = client1.admin().indices().prepareOptimize("test").execute().actionGet();
        assertThat(optimizeResponse.successfulShards(), equalTo(10));
        assertThat(optimizeResponse.failedShards(), equalTo(0));

        GetResponse getResult;

        logger.info("Get [type1/1]");
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.refresh.RefreshResponse.successfulShards()

        for (int i = 0; i < 100; i++) {
            index(client("server1"), Integer.toString(i), "test", i);
        }
        RefreshResponse refreshResponse = client("server1").admin().indices().refresh(refreshRequest("test")).actionGet();
        assertThat(refreshResponse.totalShards(), equalTo(9));
        assertThat(refreshResponse.successfulShards(), equalTo(3));
        assertThat(refreshResponse.failedShards(), equalTo(0));
        for (int i = 0; i < 5; i++) {
            try {
                SearchResponse searchResponse = client("server1").search(searchRequest("test").source(Unicode.fromStringAsBytes("{ xxx }"))).actionGet();
                assertThat(searchResponse.totalShards(), equalTo(3));
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.refresh.RefreshResponse.successfulShards()

        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.YELLOW));
        assertThat(clusterHealth.activeShards(), equalTo(6));

        refreshResponse = client("server1").admin().indices().refresh(refreshRequest("test")).actionGet();
        assertThat(refreshResponse.totalShards(), equalTo(9));
        assertThat(refreshResponse.successfulShards(), equalTo(6));
        assertThat(refreshResponse.failedShards(), equalTo(0));

        for (int i = 0; i < 5; i++) {
            try {
                SearchResponse searchResponse = client("server1").search(searchRequest("test").source(Unicode.fromStringAsBytes("{ xxx }"))).actionGet();
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.refresh.RefreshResponse.successfulShards()

        assertThat(flushResponse.successfulShards(), equalTo(5));
        assertThat(flushResponse.failedShards(), equalTo(0));
        client("server1").index(indexRequest("test").type("type1").id("2").source(source("2", "test"))).actionGet();
        RefreshResponse refreshResponse = client("server1").admin().indices().refresh(refreshRequest("test")).actionGet();
        assertThat(refreshResponse.totalShards(), equalTo(10));
        assertThat(refreshResponse.successfulShards(), equalTo(5));
        assertThat(refreshResponse.failedShards(), equalTo(0));

        startNode("server2", recoverySettings());

        logger.info("Running Cluster Health");
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.