Examples of RiverClusterStateUpdateTask


Examples of org.elasticsearch.river.cluster.RiverClusterStateUpdateTask

    @Override public void clusterChanged(final ClusterChangedEvent event) {
        if (!event.localNodeMaster()) {
            return;
        }
        riverClusterService.submitStateUpdateTask("reroute_rivers_node_changed", new RiverClusterStateUpdateTask() {
            @Override public RiverClusterState execute(RiverClusterState currentState) {
                if (!event.state().metaData().hasIndex(riverIndexName)) {
                    // if there are routings, publish an empty one (so it will be deleted on nodes), otherwise, return the same state
                    if (!currentState.routing().isEmpty()) {
                        return RiverClusterState.builder().state(currentState).routing(RiversRouting.builder()).build();
View Full Code Here

Examples of org.elasticsearch.river.cluster.RiverClusterStateUpdateTask

            return;
        }
        final String source = "reroute_rivers_node_changed";
        //we'll try again a few times if we don't find the river _meta document while the type is there
        final CountDown countDown = new CountDown(RIVER_START_MAX_RETRIES);
        riverClusterService.submitStateUpdateTask(source, new RiverClusterStateUpdateTask() {
            @Override
            public RiverClusterState execute(RiverClusterState currentState) {
                return updateRiverClusterState(source, currentState, event.state(), countDown);
            }
        });
View Full Code Here

Examples of org.elasticsearch.river.cluster.RiverClusterStateUpdateTask

                logger.debug("no river _meta document found retrying in {} ms", RIVER_START_RETRY_INTERVAL.millis());
                try {
                    threadPool.schedule(RIVER_START_RETRY_INTERVAL, ThreadPool.Names.GENERIC, new Runnable() {
                        @Override
                        public void run() {
                            riverClusterService.submitStateUpdateTask(source, new RiverClusterStateUpdateTask() {
                                @Override
                                public RiverClusterState execute(RiverClusterState currentState) {
                                    return updateRiverClusterState(source, currentState, riverClusterService.state(), countDown);
                                }
                            });
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.