Examples of blocks()


Examples of org.elasticsearch.cluster.ClusterState.blocks()

        Thread.sleep(3000);

        state = client("node1").admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(false));
        state = client("node2").admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(false));

        state = client("node1").admin().cluster().prepareState().execute().actionGet().state();
        assertThat(state.nodes().size(), equalTo(2));
        assertThat(state.metaData().indices().containsKey("test"), equalTo(true));
View Full Code Here

Examples of org.elasticsearch.cluster.ClusterState.blocks()

        closeNode(nonMasterNodeName);

        Thread.sleep(200);

        state = client(masterNodeName).admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(true));

        logger.info("--> starting the previous master node again...");
        startNode(nonMasterNodeName, settings);

        Thread.sleep(3000);
View Full Code Here

Examples of org.elasticsearch.cluster.ClusterState.blocks()

        startNode(nonMasterNodeName, settings);

        Thread.sleep(3000);

        state = client("node1").admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(false));
        state = client("node2").admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(false));

        state = client("node1").admin().cluster().prepareState().execute().actionGet().state();
        assertThat(state.nodes().size(), equalTo(2));
View Full Code Here

Examples of org.elasticsearch.cluster.ClusterState.blocks()

        Thread.sleep(3000);

        state = client("node1").admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(false));
        state = client("node2").admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(false));

        state = client("node1").admin().cluster().prepareState().execute().actionGet().state();
        assertThat(state.nodes().size(), equalTo(2));
        assertThat(state.metaData().indices().containsKey("test"), equalTo(true));
View Full Code Here

Examples of org.elasticsearch.cluster.ClusterState.blocks()

        startNode("node1", settings);
        startNode("node2", settings);

        Thread.sleep(500);
        ClusterState state = client("node1").admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(true));
        state = client("node2").admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(true));

        logger.info("--> start two more nodes");
        startNode("node3", settings);
View Full Code Here

Examples of org.elasticsearch.cluster.ClusterState.blocks()

        Thread.sleep(500);
        ClusterState state = client("node1").admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(true));
        state = client("node2").admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(true));

        logger.info("--> start two more nodes");
        startNode("node3", settings);
        startNode("node4", settings);
View Full Code Here

Examples of org.elasticsearch.cluster.ClusterState.blocks()

        Thread.sleep(3000);

        String lastNonMasterNodeUp = nonMasterNodes.removeLast();
        logger.info("--> verify that there is no master anymore on remaining nodes");
        state = client(masterNode).admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(true));
        state = client(lastNonMasterNodeUp).admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(true));

        logger.info("--> start back the nodes {}", nodesToShutdown);
        for (String nodeToShutdown : nodesToShutdown) {
View Full Code Here

Examples of org.elasticsearch.cluster.ClusterState.blocks()

        String lastNonMasterNodeUp = nonMasterNodes.removeLast();
        logger.info("--> verify that there is no master anymore on remaining nodes");
        state = client(masterNode).admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(true));
        state = client(lastNonMasterNodeUp).admin().cluster().prepareState().setLocal(true).execute().actionGet().state();
        assertThat(state.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK), equalTo(true));

        logger.info("--> start back the nodes {}", nodesToShutdown);
        for (String nodeToShutdown : nodesToShutdown) {
            startNode(nodeToShutdown, settings);
        }
View Full Code Here

Examples of org.elasticsearch.cluster.ClusterState.blocks()

        // if we received initial state, see if we can recover within the start phase, so we hold the
        // node from starting until we recovered properly
        if (discoveryService.initialStateReceived()) {
            ClusterState clusterState = clusterService.state();
            DiscoveryNodes nodes = clusterState.nodes();
            if (clusterState.nodes().localNodeMaster() && clusterState.blocks().hasGlobalBlock(STATE_NOT_RECOVERED_BLOCK)) {
                if (clusterState.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK)) {
                    logger.debug("not recovering from gateway, no master elected yet");
                } else if (recoverAfterNodes != -1 && (nodes.masterAndDataNodes().size()) < recoverAfterNodes) {
                    logger.debug("not recovering from gateway, nodes_size (data+master) [" + nodes.masterAndDataNodes().size() + "] < recover_after_nodes [" + recoverAfterNodes + "]");
                } else if (recoverAfterDataNodes != -1 && nodes.dataNodes().size() < recoverAfterDataNodes) {
View Full Code Here

Examples of org.elasticsearch.cluster.ClusterState.blocks()

        // node from starting until we recovered properly
        if (discoveryService.initialStateReceived()) {
            ClusterState clusterState = clusterService.state();
            DiscoveryNodes nodes = clusterState.nodes();
            if (clusterState.nodes().localNodeMaster() && clusterState.blocks().hasGlobalBlock(STATE_NOT_RECOVERED_BLOCK)) {
                if (clusterState.blocks().hasGlobalBlock(Discovery.NO_MASTER_BLOCK)) {
                    logger.debug("not recovering from gateway, no master elected yet");
                } else if (recoverAfterNodes != -1 && (nodes.masterAndDataNodes().size()) < recoverAfterNodes) {
                    logger.debug("not recovering from gateway, nodes_size (data+master) [" + nodes.masterAndDataNodes().size() + "] < recover_after_nodes [" + recoverAfterNodes + "]");
                } else if (recoverAfterDataNodes != -1 && nodes.dataNodes().size() < recoverAfterDataNodes) {
                    logger.debug("not recovering from gateway, nodes_size (data) [" + nodes.dataNodes().size() + "] < recover_after_data_nodes [" + recoverAfterDataNodes + "]");
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.