Examples of routingTable()


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

                    }

                    ClusterState updatedState = newClusterStateBuilder().state(currentState).blocks(blocks).metaData(newMetaData).build();

                    if (request.state == State.OPEN) {
                        RoutingTable.Builder routingTableBuilder = RoutingTable.builder().routingTable(updatedState.routingTable());
                        IndexRoutingTable.Builder indexRoutingBuilder = new IndexRoutingTable.Builder(request.index)
                                .initializeEmpty(updatedState.metaData().index(request.index), true);
                        routingTableBuilder.add(indexRoutingBuilder);
                        RoutingAllocation.Result routingResult = shardsAllocation.reroute(newClusterStateBuilder().state(updatedState).routingTable(routingTableBuilder).build());
                        updatedState = newClusterStateBuilder().state(updatedState).routingResult(routingResult).build();
View Full Code Here

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

                    }

                    ClusterState updatedState = newClusterStateBuilder().state(currentState).blocks(blocks).metaData(newMetaData).build();

                    if (request.state == State.OPEN) {
                        RoutingTable.Builder routingTableBuilder = RoutingTable.builder().routingTable(updatedState.routingTable());
                        IndexRoutingTable.Builder indexRoutingBuilder = new IndexRoutingTable.Builder(request.index)
                                .initializeEmpty(updatedState.metaData().index(request.index), true);
                        routingTableBuilder.add(indexRoutingBuilder);
                        RoutingAllocation.Result routingResult = shardsAllocation.reroute(newClusterStateBuilder().state(updatedState).routingTable(routingTableBuilder).build());
                        updatedState = newClusterStateBuilder().state(updatedState).routingResult(routingResult).build();
View Full Code Here

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

        ClusterState.Builder builder = newClusterStateBuilder();
        if (!request.filterNodes()) {
            builder.nodes(currentState.nodes());
        }
        if (!request.filterRoutingTable()) {
            builder.routingTable(currentState.routingTable());
            builder.allocationExplanation(currentState.allocationExplanation());
        }
        if (!request.filterBlocks()) {
            builder.blocks(currentState.blocks());
        }
View Full Code Here

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

        ClusterState.Builder builder = newClusterStateBuilder();
        if (!request.filterNodes()) {
            builder.nodes(currentState.nodes());
        }
        if (!request.filterRoutingTable()) {
            builder.routingTable(currentState.routingTable());
            builder.allocationExplanation(currentState.allocationExplanation());
        }
        if (!request.filterBlocks()) {
            builder.blocks(currentState.blocks());
        }
View Full Code Here

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

                    // routing table
                    if (!clusterStateRequest.filterRoutingTable()) {
                        builder.startObject("routing_table");
                        builder.startObject("indices");
                        for (IndexRoutingTable indexRoutingTable : state.routingTable()) {
                            builder.startObject(indexRoutingTable.index(), XContentBuilder.FieldCaseConversion.NONE);
                            builder.startObject("shards");
                            for (IndexShardRoutingTable indexShardRoutingTable : indexRoutingTable) {
                                builder.startArray(Integer.toString(indexShardRoutingTable.shardId().id()));
                                for (ShardRouting shardRouting : indexShardRoutingTable) {
View Full Code Here

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

                if (nodeSpecificClusterState.nodes().localNode() != null) {
                    discovery.clusterService.submitStateUpdateTask("local-disco-receive(from master)", new ProcessedClusterStateUpdateTask() {
                        @Override public ClusterState execute(ClusterState currentState) {
                            ClusterState.Builder builder = ClusterState.builder().state(nodeSpecificClusterState);
                            // if the routing table did not change, use the original one
                            if (nodeSpecificClusterState.routingTable().version() == currentState.routingTable().version()) {
                                builder.routingTable(currentState.routingTable());
                            }
                            if (nodeSpecificClusterState.metaData().version() == currentState.metaData().version()) {
                                builder.metaData(currentState.metaData());
                            }
View Full Code Here

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

                if (nodeSpecificClusterState.nodes().localNode() != null) {
                    discovery.clusterService.submitStateUpdateTask("local-disco-receive(from master)", new ProcessedClusterStateUpdateTask() {
                        @Override public ClusterState execute(ClusterState currentState) {
                            ClusterState.Builder builder = ClusterState.builder().state(nodeSpecificClusterState);
                            // if the routing table did not change, use the original one
                            if (nodeSpecificClusterState.routingTable().version() == currentState.routingTable().version()) {
                                builder.routingTable(currentState.routingTable());
                            }
                            if (nodeSpecificClusterState.metaData().version() == currentState.metaData().version()) {
                                builder.metaData(currentState.metaData());
                            }
View Full Code Here

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

                }
                if (previousClusterState != clusterState) {
                    if (clusterState.nodes().localNodeMaster()) {
                        // only the master controls the version numbers
                        Builder builder = ClusterState.builder().state(clusterState).version(clusterState.version() + 1);
                        if (previousClusterState.routingTable() != clusterState.routingTable()) {
                            builder.routingTable(RoutingTable.builder().routingTable(clusterState.routingTable()).version(clusterState.routingTable().version() + 1));
                        }
                        if (previousClusterState.metaData() != clusterState.metaData()) {
                            builder.metaData(MetaData.builder().metaData(clusterState.metaData()).version(clusterState.metaData().version() + 1));
                        }
View Full Code Here

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

                }
                if (previousClusterState != clusterState) {
                    if (clusterState.nodes().localNodeMaster()) {
                        // only the master controls the version numbers
                        Builder builder = ClusterState.builder().state(clusterState).version(clusterState.version() + 1);
                        if (previousClusterState.routingTable() != clusterState.routingTable()) {
                            builder.routingTable(RoutingTable.builder().routingTable(clusterState.routingTable()).version(clusterState.routingTable().version() + 1));
                        }
                        if (previousClusterState.metaData() != clusterState.metaData()) {
                            builder.metaData(MetaData.builder().metaData(clusterState.metaData()).version(clusterState.metaData().version() + 1));
                        }
View Full Code Here

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

         * Returns <tt>true</tt> if the action starting to be performed on the primary (or is done).
         */
        public boolean start(final boolean fromClusterEvent) throws ElasticSearchException {
            final ClusterState clusterState = clusterService.state();
            nodes = clusterState.nodes();
            if (!clusterState.routingTable().hasIndex(request.index())) {
                retry(fromClusterEvent, null);
                return false;
            }
            try {
                shardIt = shards(clusterState, request);
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.