From 11dbbebb7a2481c1c60b13e79c8eff3195fb4605 Mon Sep 17 00:00:00 2001 From: kimchy Date: Sat, 21 Aug 2010 17:50:08 +0300 Subject: [PATCH] renamve var to better reflect its state (started, not active) --- .../routing/strategy/ShardsRoutingStrategy.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/strategy/ShardsRoutingStrategy.java b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/strategy/ShardsRoutingStrategy.java index 8e870818d0a..41bbb404b8c 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/strategy/ShardsRoutingStrategy.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/strategy/ShardsRoutingStrategy.java @@ -156,10 +156,10 @@ public class ShardsRoutingStrategy extends AbstractComponent { } boolean relocated = false; - List activeShards = highRoutingNode.shardsWithState(STARTED); - for (MutableShardRouting activeShard : activeShards) { + List startedShards = highRoutingNode.shardsWithState(STARTED); + for (MutableShardRouting startedShard : startedShards) { // we only relocate shards that all other shards within the replication group are active - List allShards = routingNodes.shardsRoutingFor(activeShard); + List allShards = routingNodes.shardsRoutingFor(startedShard); boolean ignoreShard = false; for (MutableShardRouting allShard : allShards) { if (!allShard.active()) { @@ -171,13 +171,13 @@ public class ShardsRoutingStrategy extends AbstractComponent { continue; } - if (lowRoutingNode.canAllocate(routingNodes.metaData(), routingNodes.routingTable()) && lowRoutingNode.canAllocate(activeShard)) { + if (lowRoutingNode.canAllocate(routingNodes.metaData(), routingNodes.routingTable()) && lowRoutingNode.canAllocate(startedShard)) { changed = true; - lowRoutingNode.add(new MutableShardRouting(activeShard.index(), activeShard.id(), - lowRoutingNode.nodeId(), activeShard.currentNodeId(), - activeShard.primary(), INITIALIZING)); + lowRoutingNode.add(new MutableShardRouting(startedShard.index(), startedShard.id(), + lowRoutingNode.nodeId(), startedShard.currentNodeId(), + startedShard.primary(), INITIALIZING)); - activeShard.relocate(lowRoutingNode.nodeId()); + startedShard.relocate(lowRoutingNode.nodeId()); relocated = true; relocationPerformed = true; break;