@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final HostStatus that = (HostStatus) obj; if (host != null ? !host.equals(that.host) : that.host != null) { return false; } if (jobId != null ? !jobId.equals(that.jobId) : that.jobId != null) { return false; } if (state != that.state) { return false; } return true; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final Deployment that = (Deployment) obj; if (jobId != null ? !jobId.equals(that.jobId) : that.jobId != null) { return false; } if (goal != that.goal) { return false; } if (deployerUser != null ? !deployerUser.equals(that.deployerUser) : that.deployerUser != null) { return false; } if (deploymentGroupName != null ? !deploymentGroupName.equals(that.deploymentGroupName) : that.deploymentGroupName != null) { return false; } return !(deployerMaster != null ? !deployerMaster .equals(that.deployerMaster) : that.deployerMaster != null); }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final DeploymentGroup that = (DeploymentGroup) obj; if (jobId != null ? !jobId.equals(that.jobId) : that.jobId != null) { return false; } if (hostSelectors != null ? !hostSelectors.equals(that.hostSelectors) : that.hostSelectors != null) { return false; } if (name != null ? !name.equals(that.name) : that.name != null) { return false; } if (rolloutOptions != null ? !rolloutOptions.equals(that.rolloutOptions) : that.rolloutOptions != null) { return false; } if (reason != null ? !reason.equals(that.reason) : that.reason != null) { return false; } return true; }
private boolean isMigration(final Deployment deployment, final DeploymentGroup deploymentGroup) { return (deploymentGroup.getRolloutOptions() != null && TRUE.equals(deploymentGroup.getRolloutOptions().getMigrate()) && deployment.getJobId().equals(deploymentGroup.getJobId())); }
@Valid final Deployment deployment, @QueryParam("token") @DefaultValue("") final String token) { if (!deployment.getJobId().equals(jobId)) { throw badRequest(new SetGoalResponse(SetGoalResponse.Status.ID_MISMATCH, host, jobId));
if (!deployment.getJobId().equals(deploymentGroup.getJobId())) { return false;
&& hostStatus.getJobId().equals(jobId);
@Valid final Deployment deployment, @QueryParam("token") @DefaultValue("") final String token) { if (!deployment.getJobId().equals(jobId)) { throw badRequest(new SetGoalResponse(SetGoalResponse.Status.ID_MISMATCH, host, jobId));
private RollingUpdateTaskResult rollingUpdateUndeploy(final DeploymentGroup deploymentGroup, final String host) { final ZooKeeperClient client = provider.get("rollingUpdateUndeploy"); final List<ZooKeeperOperation> operations = Lists.newArrayList(); for (final Deployment deployment : getTasks(client, host).values()) { final boolean isOwnedByDeploymentGroup = Objects.equals( deployment.getDeploymentGroupName(), deploymentGroup.getName()); final boolean isSameJob = deployment.getJobId().equals(deploymentGroup.getJobId()); if (isOwnedByDeploymentGroup || ( isSameJob && deploymentGroup.getRolloutOptions().getMigrate())) { if (isSameJob && isOwnedByDeploymentGroup && deployment.getGoal().equals(Goal.START)) { // The job we want deployed is already deployed and set to run, so just leave it. continue; } try { operations.addAll(getUndeployOperations(client, host, deployment.getJobId(), Job.EMPTY_TOKEN)); } catch (TokenVerificationException | HostNotFoundException e) { return RollingUpdateTaskResult.error(e, host); } catch (JobNotDeployedException e) { // probably somebody beat us to the punch of undeploying. that's fine. } } } return RollingUpdateTaskResult.of(operations); }
hostStatus.getJobId().equals(jobId);