Examples of numberOfShardsWithState()


Examples of org.elasticsearch.cluster.routing.RoutingNode.numberOfShardsWithState()

        Thread.sleep(200);


        ClusterState clusterState1 = clusterService1.state();
        RoutingNode routingNodeEntry1 = clusterState1.readOnlyRoutingNodes().nodesToShards().get(clusterState1.nodes().localNodeId());
        assertThat(routingNodeEntry1.numberOfShardsWithState(STARTED), equalTo(11));

        clusterState1 = client("server1").admin().cluster().state(clusterStateRequest()).actionGet().state();
        routingNodeEntry1 = clusterState1.readOnlyRoutingNodes().nodesToShards().get(clusterState1.nodes().localNodeId());
        assertThat(routingNodeEntry1.numberOfShardsWithState(STARTED), equalTo(11));
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNode.numberOfShardsWithState()

        RoutingNode routingNodeEntry1 = clusterState1.readOnlyRoutingNodes().nodesToShards().get(clusterState1.nodes().localNodeId());
        assertThat(routingNodeEntry1.numberOfShardsWithState(STARTED), equalTo(11));

        clusterState1 = client("server1").admin().cluster().state(clusterStateRequest()).actionGet().state();
        routingNodeEntry1 = clusterState1.readOnlyRoutingNodes().nodesToShards().get(clusterState1.nodes().localNodeId());
        assertThat(routingNodeEntry1.numberOfShardsWithState(STARTED), equalTo(11));

        logger.info("Starting server2");
        // start another server
        startNode("server2", settings);
        ClusterService clusterService2 = ((InternalNode) node("server2")).injector().getInstance(ClusterService.class);
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNode.numberOfShardsWithState()

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

        clusterState1 = clusterService1.state();
        routingNodeEntry1 = clusterState1.readOnlyRoutingNodes().nodesToShards().get(clusterState1.nodes().localNodeId());
        assertThat(routingNodeEntry1.numberOfShardsWithState(STARTED), equalTo(11));

        ClusterState clusterState2 = clusterService2.state();
        RoutingNode routingNodeEntry2 = clusterState2.readOnlyRoutingNodes().nodesToShards().get(clusterState2.nodes().localNodeId());
        assertThat(routingNodeEntry2.numberOfShardsWithState(STARTED), equalTo(11));
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNode.numberOfShardsWithState()

        routingNodeEntry1 = clusterState1.readOnlyRoutingNodes().nodesToShards().get(clusterState1.nodes().localNodeId());
        assertThat(routingNodeEntry1.numberOfShardsWithState(STARTED), equalTo(11));

        ClusterState clusterState2 = clusterService2.state();
        RoutingNode routingNodeEntry2 = clusterState2.readOnlyRoutingNodes().nodesToShards().get(clusterState2.nodes().localNodeId());
        assertThat(routingNodeEntry2.numberOfShardsWithState(STARTED), equalTo(11));

        logger.info("Starting server3");
        // start another server
        startNode("server3", settings);
        Thread.sleep(200);
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNode.numberOfShardsWithState()

        routingNodeEntry1 = clusterState1.readOnlyRoutingNodes().nodesToShards().get(clusterState1.nodes().localNodeId());
        assertThat(routingNodeEntry1.numberOfShardsWithState(STARTED), anyOf(equalTo(7), equalTo(8)));

        clusterState2 = clusterService2.state();
        routingNodeEntry2 = clusterState2.readOnlyRoutingNodes().nodesToShards().get(clusterState2.nodes().localNodeId());
        assertThat(routingNodeEntry2.numberOfShardsWithState(STARTED), anyOf(equalTo(7), equalTo(8)));

        ClusterState clusterState3 = clusterService3.state();
        RoutingNode routingNodeEntry3 = clusterState3.readOnlyRoutingNodes().nodesToShards().get(clusterState3.nodes().localNodeId());
        assertThat(routingNodeEntry3.numberOfShardsWithState(STARTED), equalTo(7));
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNode.numberOfShardsWithState()

        routingNodeEntry2 = clusterState2.readOnlyRoutingNodes().nodesToShards().get(clusterState2.nodes().localNodeId());
        assertThat(routingNodeEntry2.numberOfShardsWithState(STARTED), anyOf(equalTo(7), equalTo(8)));

        ClusterState clusterState3 = clusterService3.state();
        RoutingNode routingNodeEntry3 = clusterState3.readOnlyRoutingNodes().nodesToShards().get(clusterState3.nodes().localNodeId());
        assertThat(routingNodeEntry3.numberOfShardsWithState(STARTED), equalTo(7));

        assertThat(routingNodeEntry1.numberOfShardsWithState(STARTED) + routingNodeEntry2.numberOfShardsWithState(STARTED) + routingNodeEntry3.numberOfShardsWithState(STARTED), equalTo(22));

        logger.info("Closing server1");
        // kill the first server
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNode.numberOfShardsWithState()

        ClusterState clusterState3 = clusterService3.state();
        RoutingNode routingNodeEntry3 = clusterState3.readOnlyRoutingNodes().nodesToShards().get(clusterState3.nodes().localNodeId());
        assertThat(routingNodeEntry3.numberOfShardsWithState(STARTED), equalTo(7));

        assertThat(routingNodeEntry1.numberOfShardsWithState(STARTED) + routingNodeEntry2.numberOfShardsWithState(STARTED) + routingNodeEntry3.numberOfShardsWithState(STARTED), equalTo(22));

        logger.info("Closing server1");
        // kill the first server
        closeNode("server1");
        // verify health
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNode.numberOfShardsWithState()

        routingNodeEntry2 = clusterState2.readOnlyRoutingNodes().nodesToShards().get(clusterState2.nodes().localNodeId());
        assertThat(routingNodeEntry2.numberOfShardsWithState(STARTED), equalTo(11));

        clusterState3 = clusterService3.state();
        routingNodeEntry3 = clusterState3.readOnlyRoutingNodes().nodesToShards().get(clusterState3.nodes().localNodeId());
        assertThat(routingNodeEntry3.numberOfShardsWithState(STARTED), equalTo(11));

        assertThat(routingNodeEntry2.numberOfShardsWithState(STARTED) + routingNodeEntry3.numberOfShardsWithState(STARTED), equalTo(22));

        logger.info("Deleting index [test]");
        // last, lets delete the index
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNode.numberOfShardsWithState()

        clusterState3 = clusterService3.state();
        routingNodeEntry3 = clusterState3.readOnlyRoutingNodes().nodesToShards().get(clusterState3.nodes().localNodeId());
        assertThat(routingNodeEntry3.numberOfShardsWithState(STARTED), equalTo(11));

        assertThat(routingNodeEntry2.numberOfShardsWithState(STARTED) + routingNodeEntry3.numberOfShardsWithState(STARTED), equalTo(22));

        logger.info("Deleting index [test]");
        // last, lets delete the index
        DeleteIndexResponse deleteIndexResponse = client("server2").admin().indices().prepareDelete("test").execute().actionGet();
        assertThat(deleteIndexResponse.acknowledged(), equalTo(true));
View Full Code Here

Examples of org.elasticsearch.cluster.routing.RoutingNode.numberOfShardsWithState()

        assertThat(clusterHealth.activeShards(), equalTo(11));
        assertThat(clusterHealth.activePrimaryShards(), equalTo(11));

        ClusterState clusterState1 = clusterService1.state();
        RoutingNode routingNodeEntry1 = clusterState1.readOnlyRoutingNodes().nodesToShards().get(clusterState1.nodes().localNodeId());
        assertThat(routingNodeEntry1.numberOfShardsWithState(STARTED), equalTo(11));

        // start another server
        logger.info("Starting server2");
        startNode("server2", settings);
        Thread.sleep(200);
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.