Source:
<code>private RollingUpdateOp generateOps(final ZooKeeperClient client, final RollingOperation rolling, final List<ZooKeeperOperation> operations, final List<String> hosts) throws DeploymentGroupDoesNotExistException { final RollingOperationStatus status = RollingOperationStatus.newBuilder() .setState(NEW) .build(); try { <START> if (client.exists(Paths.configDeploymentGroup(rolling.getDeploymentGroupName())) == null) { <END> throw new DeploymentGroupDoesNotExistException(rolling.getDeploymentGroupName()); } client.ensurePath(Paths.configRollingOps()); client.ensurePath(Paths.statusRollingOps()); operations.add(create(Paths.configRollingOp(rolling.getId()), rolling)); operations.add(create(Paths.statusRollingOp(rolling.getId()), status)); prependRollingOperation( client, operations, rolling.getDeploymentGroupName(), rolling.getId()); final Map<String, HostStatus> hostsAndStatuses = Maps.newLinkedHashMap(); for (final String host : hosts) { hostsAndStatuses.put(host, getHostStatus(host)); } final RolloutPlanner rolloutPlanner = DefaultRolloutPlanner.of(rolling); final List<RolloutTask> rolloutTasks = rolloutPlanner.plan(hostsAndStatuses); final RollingOperationTasks tasks = RollingOperationTasks.newBuilder() .setRolloutTasks(rolloutTasks) .setTaskIndex(0) .setRollingOperation(rolling) .build(); final RollingUpdateOpFactory opFactory = new RollingUpdateOpFactory( tasks, ROLLING_OPERATION_EVENT_FACTORY); return opFactory.start(client, operations); } catch (final KeeperException e) { throw new HeliosRuntimeException( "rolling-operation " + rolling.getId() + " on deployment-group " + rolling.getDeploymentGroupName() + " failed to generate operations", e); } }</code><technical_language>ZooKeeperMasterModel.getDeploymentGroup()</technical_language>

Target:
private RollingUpdateOp generateOps(final ZooKeeperClient client, final RollingOperation rolling, final List<ZooKeeperOperation> operations, final List<String> hosts) throws DeploymentGroupDoesNotExistException { final RollingOperationStatus status = RollingOperationStatus.newBuilder() .setState(NEW) .build(); try { getDeploymentGroup(client, rolling.getDeploymentGroupName()); client.ensurePath(Paths.configRollingOps()); client.ensurePath(Paths.statusRollingOps()); operations.add(create(Paths.configRollingOp(rolling.getId()), rolling)); operations.add(create(Paths.statusRollingOp(rolling.getId()), status)); prependRollingOperation( client, operations, rolling.getDeploymentGroupName(), rolling.getId()); final Map<String, HostStatus> hostsAndStatuses = Maps.newLinkedHashMap(); for (final String host : hosts) { hostsAndStatuses.put(host, getHostStatus(host)); } final RolloutPlanner rolloutPlanner = DefaultRolloutPlanner.of(rolling); final List<RolloutTask> rolloutTasks = rolloutPlanner.plan(hostsAndStatuses); final RollingOperationTasks tasks = RollingOperationTasks.newBuilder() .setRolloutTasks(rolloutTasks) .setTaskIndex(0) .setRollingOperation(rolling) .build(); final RollingUpdateOpFactory opFactory = new RollingUpdateOpFactory( tasks, ROLLING_OPERATION_EVENT_FACTORY); return opFactory.start(client, operations); } catch (final KeeperException e) { throw new HeliosRuntimeException( "rolling-operation " + rolling.getId() + " on deployment-group " + rolling.getDeploymentGroupName() + " failed to generate operations", e); } }