} else if (shardRouting.relocating()) { initializingShard = shardRouting.cancelRelocation() .relocate(currentNodeId, ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE) .getTargetRelocatingShard(); } else { assert shardRouting.started(); initializingShard = shardRouting.relocate(currentNodeId, ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE) .getTargetRelocatingShard();
public static ShardRouting relocate(ShardRouting shardRouting, String relocatingNodeId, long expectedShardSize) { return shardRouting.relocate(relocatingNodeId, expectedShardSize); }
public static ShardRouting relocate(ShardRouting routing, String nodeId, long expectedByteSize) { return routing.relocate(nodeId, expectedByteSize); }
/** * Relocate a shard to another node, adding the target initializing * shard as well as assigning it. * * @return pair of source relocating and target initializing shards. */ public Tuple<ShardRouting,ShardRouting> relocateShard(ShardRouting startedShard, String nodeId, long expectedShardSize, RoutingChangesObserver changes) { ensureMutable(); relocatingShards++; ShardRouting source = startedShard.relocate(nodeId, expectedShardSize); ShardRouting target = source.getTargetRelocatingShard(); updateAssigned(startedShard, source); node(target.currentNodeId()).add(target); assignedShardsAdd(target); addRecovery(target); changes.relocationStarted(startedShard, target); return Tuple.tuple(source, target); }
} else { assert decision.type() == Type.THROTTLE; minNode.addShard(candidate.relocate(minNode.getNodeId(), shardSize));
/** * Relocate a shard to another node, adding the target initializing * shard as well as assigning it. And returning the target initializing * shard. */ public ShardRouting relocate(ShardRouting shard, String nodeId, long expectedShardSize) { ensureMutable(); relocatingShards++; shard.relocate(nodeId, expectedShardSize); ShardRouting target = shard.buildTargetRelocatingShard(); node(target.currentNodeId()).add(target); assignedShardsAdd(target); return target; }
} else if (shardRouting.relocating()) { initializingShard = shardRouting.cancelRelocation() .relocate(currentNodeId, ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE) .getTargetRelocatingShard(); } else { assert shardRouting.started(); initializingShard = shardRouting.relocate(currentNodeId, ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE) .getTargetRelocatingShard();
} else if (shardRouting.relocating()) { initializingShard = shardRouting.cancelRelocation() .relocate(currentNodeId, ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE) .getTargetRelocatingShard(); } else { assert shardRouting.started(); initializingShard = shardRouting.relocate(currentNodeId, ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE) .getTargetRelocatingShard();
} else if (shardRouting.relocating()) { initializingShard = shardRouting.cancelRelocation() .relocate(currentNodeId, ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE) .getTargetRelocatingShard(); } else { assert shardRouting.started(); initializingShard = shardRouting.relocate(currentNodeId, ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE) .getTargetRelocatingShard();
/** * Relocate a shard to another node, adding the target initializing * shard as well as assigning it. * * @return pair of source relocating and target initializing shards. */ public Tuple<ShardRouting,ShardRouting> relocateShard(ShardRouting startedShard, String nodeId, long expectedShardSize, RoutingChangesObserver changes) { ensureMutable(); relocatingShards++; ShardRouting source = startedShard.relocate(nodeId, expectedShardSize); ShardRouting target = source.getTargetRelocatingShard(); updateAssigned(startedShard, source); node(target.currentNodeId()).add(target); assignedShardsAdd(target); addRecovery(target); changes.relocationStarted(startedShard, target); return Tuple.tuple(source, target); }
/** * Relocate a shard to another node, adding the target initializing * shard as well as assigning it. * * @return pair of source relocating and target initializing shards. */ public Tuple<ShardRouting,ShardRouting> relocateShard(ShardRouting startedShard, String nodeId, long expectedShardSize, RoutingChangesObserver changes) { ensureMutable(); relocatingShards++; ShardRouting source = startedShard.relocate(nodeId, expectedShardSize); ShardRouting target = source.getTargetRelocatingShard(); updateAssigned(startedShard, source); node(target.currentNodeId()).add(target); assignedShardsAdd(target); addRecovery(target); changes.relocationStarted(startedShard, target); return Tuple.tuple(source, target); }
/** * Relocate a shard to another node, adding the target initializing * shard as well as assigning it. * * @return pair of source relocating and target initializing shards. */ public Tuple<ShardRouting,ShardRouting> relocateShard(ShardRouting startedShard, String nodeId, long expectedShardSize, RoutingChangesObserver changes) { ensureMutable(); relocatingShards++; ShardRouting source = startedShard.relocate(nodeId, expectedShardSize); ShardRouting target = source.getTargetRelocatingShard(); updateAssigned(startedShard, source); node(target.currentNodeId()).add(target); assignedShardsAdd(target); addRecovery(target); changes.relocationStarted(startedShard, target); return Tuple.tuple(source, target); }
} else { assert decision.type() == Type.THROTTLE; minNode.addShard(candidate.relocate(minNode.getNodeId(), shardSize));
} else { assert decision.type() == Type.THROTTLE; minNode.addShard(candidate.relocate(minNode.getNodeId(), shardSize));
} else { assert decision.type() == Type.THROTTLE; minNode.addShard(candidate.relocate(minNode.getNodeId(), shardSize));