private RollingUpdateOp rollingUpdateAwaitUndeployed(final ZooKeeperClient client, final RollingUpdateOpFactory opFactory, final DeploymentGroup deploymentGroup, final String host) { final TaskStatus taskStatus = getTaskStatus(client, host, deploymentGroup.getJobId()); if (taskStatus == null) { // The task status (i.e. /status/hosts/<host>/job/<job-id>) has been removed, indicating the // job has been undeployed. return opFactory.nextTask(); } if (isRolloutTimedOut(client, deploymentGroup)) { return opFactory.error("timed out while waiting for job undeployment", host, RollingUpdateError.TIMED_OUT_WAITING_FOR_JOB_TO_UNDEPLOY); } return opFactory.yield(); }