// Important: only look for instances to be replaced in the current stage
final Iterator<ExecutionGroupVertex> groupIterator = new ExecutionGroupVertexIterator(eg, true,
stage.getStageNumber());
while (groupIterator.hasNext()) {
final ExecutionGroupVertex groupVertex = groupIterator.next();
for (int i = 0; i < groupVertex.getCurrentNumberOfGroupMembers(); ++i) {
final ExecutionVertex vertex = groupVertex.getGroupMember(i);
if (vertex.getExecutionState() == ExecutionState.SCHEDULED
&& vertex.getAllocatedResource() != null) {
// In local mode, we do not consider any topology, only the instance type
if (vertex.getAllocatedResource().getInstanceType().equals(