Package org.elasticsearch.test.InternalTestCluster

Examples of org.elasticsearch.test.InternalTestCluster.RestartCallback


        for (int i = 0; i < 10; i++) {
            assertHitCount(client().prepareCount().setQuery(matchAllQuery()).execute().actionGet(), 2);
        }

        internalCluster().fullRestart(new RestartCallback() {
            @Override
            public Settings onNodeStopped(String nodeName) throws Exception {
                return settingsBuilder().put("gateway.recover_after_nodes", 2).build();
            }
View Full Code Here


        String metaDataUuid = client().admin().cluster().prepareState().execute().get().getState().getMetaData().uuid();
        assertThat(metaDataUuid, not(equalTo("_na_")));

        logger.info("--> closing first node, and indexing more data to the second node");
        internalCluster().fullRestart(new RestartCallback() {

            @Override
            public void doAfterNodes(int numNodes, Client client) throws Exception {
                if (numNodes == 1) {
                    logger.info("--> one node is closed - start indexing data into the second one");
View Full Code Here

        internalCluster().startNode(settingsBuilder().put("path.data", "data/data2").build());

        ensureGreen();

        internalCluster().fullRestart(new RestartCallback() {

            @Override
            public boolean doRestart(String nodeName) {
                return !node_1.equals(nodeName);
            }
View Full Code Here

        }
        assertThat(client().prepareGet("test", "type1", "1").execute().actionGet().isExists(), equalTo(true));

        logger.info("--> restarting the nodes");
        final Gateway gateway1 = internalCluster().getInstance(Gateway.class, node_1);
        internalCluster().fullRestart(new RestartCallback() {
            @Override
            public Settings onNodeStopped(String nodeName) throws Exception {
                if (node_1.equals(nodeName)) {
                    logger.info("--> deleting the data for the first node");
                    gateway1.reset();
View Full Code Here

        }
        assertThat(client().prepareGet("test", "type1", "1").execute().actionGet().isExists(), equalTo(true));

        logger.info("--> restarting the nodes");
        final Gateway gateway1 = internalCluster().getInstance(Gateway.class, node_1);
        internalCluster().fullRestart(new RestartCallback() {
            @Override
            public Settings onNodeStopped(String nodeName) throws Exception {
                if (node_1.equals(nodeName)) {
                    logger.info("--> deleting the data for the first node");
                    gateway1.reset();
View Full Code Here

        }
        assertThat(client().prepareGet("test", "type1", "1").execute().actionGet().isExists(), equalTo(true));

        logger.info("--> restarting the nodes");
        final Gateway gateway1 = internalCluster().getInstance(Gateway.class, node_1);
        internalCluster().fullRestart(new RestartCallback() {

            @Override
            public Settings onNodeStopped(String nodeName) throws Exception {
                if (node_1.equals(nodeName)) {
                    logger.info("--> deleting the data for the first node");
                    gateway1.reset();
                }
                return null;
            }
        });

        logger.info("--> waiting for green status");
        ensureGreen();

        // we need to wait for the allocate dangled to kick in (even though in this case its disabled)
        // just to make sure
        Thread.sleep(500);

        logger.info("--> verify that the dangling index does not exists");
        assertThat(client().admin().indices().prepareExists("test").execute().actionGet().isExists(), equalTo(false));

        logger.info("--> restart start the nodes, but make sure we do recovery only after we have 2 nodes in the cluster");
        internalCluster().fullRestart(new RestartCallback() {
            @Override
            public Settings onNodeStopped(String nodeName) throws Exception {
                return settingsBuilder().put("gateway.recover_after_nodes", 2).build();
            }
        });
View Full Code Here

            assertHitCount(client().prepareSearch().setQuery(matchAllQuery()).get(), 1l);
        }

        logger.info("--> restarting the nodes");
        final Gateway gateway1 = internalCluster().getInstance(Gateway.class, node_1);
        internalCluster().fullRestart(new RestartCallback() {

            @Override
            public Settings onNodeStopped(String nodeName) throws Exception {
                if (node_1.equals(nodeName)) {
                    logger.info("--> deleting the data for the first node");
View Full Code Here

            assertHitCount(client().prepareCount().setQuery(matchAllQuery()).get(), 2l);
        }
       
        final String nodeToRemove = nodes[between(0,2)];
        logger.info("--> restarting 1 nodes -- kill 2");
        internalCluster().fullRestart(new RestartCallback() {
            @Override
            public Settings onNodeStopped(String nodeName) throws Exception {
                return settingsBuilder().put("gateway.type", "local").build();
            }
           
View Full Code Here

        for (int i = 0; i < 10; i++) {
            assertHitCount(client().prepareCount().setQuery(matchAllQuery()).get(), 2l);
        }
        logger.info("--> restart all nodes");
        internalCluster().fullRestart(new RestartCallback() {
            @Override
            public Settings onNodeStopped(String nodeName) throws Exception {
                return null;
            }
View Full Code Here

TOP

Related Classes of org.elasticsearch.test.InternalTestCluster.RestartCallback

Copyright © 2018 www.massapicom. 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.