org.elasticsearch.cluster.routing.strategy
Class ShardsRoutingStrategy

java.lang.Object
  extended by org.elasticsearch.common.component.AbstractComponent
      extended by org.elasticsearch.cluster.routing.strategy.ShardsRoutingStrategy

public class ShardsRoutingStrategy
extends AbstractComponent


Field Summary
 
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
componentSettings, logger, settings
 
Constructor Summary
ShardsRoutingStrategy()
           
ShardsRoutingStrategy(Settings settings, PreferUnallocatedShardUnassignedStrategy preferUnallocatedShardUnassignedStrategy)
           
 
Method Summary
 RoutingTable applyFailedShards(ClusterState clusterState, java.lang.Iterable<? extends ShardRouting> failedShardEntries)
          Applies the failed shards.
 RoutingTable applyStartedShards(ClusterState clusterState, java.lang.Iterable<? extends ShardRouting> startedShardEntries)
          Applies the started shards.
 RoutingTable reroute(ClusterState clusterState)
          Reroutes the routing table based on the live nodes.
 
Methods inherited from class org.elasticsearch.common.component.AbstractComponent
nodeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShardsRoutingStrategy

public ShardsRoutingStrategy()

ShardsRoutingStrategy

@Inject
public ShardsRoutingStrategy(Settings settings,
                                    @Nullable
                                    PreferUnallocatedShardUnassignedStrategy preferUnallocatedShardUnassignedStrategy)
Method Detail

applyStartedShards

public RoutingTable applyStartedShards(ClusterState clusterState,
                                       java.lang.Iterable<? extends ShardRouting> startedShardEntries)
Applies the started shards. Note, shards can be called several times within this method.

If the same instance of the routing table is returned, then no change has been made.


applyFailedShards

public RoutingTable applyFailedShards(ClusterState clusterState,
                                      java.lang.Iterable<? extends ShardRouting> failedShardEntries)
Applies the failed shards. Note, shards can be called several times within this method.

If the same instance of the routing table is returned, then no change has been made.


reroute

public RoutingTable reroute(ClusterState clusterState)
Reroutes the routing table based on the live nodes.

If the same instance of the routing table is returned, then no change has been made.