diff options
author | jonmv <venstad@gmail.com> | 2022-04-16 14:58:22 +0200 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2022-04-19 10:38:07 +0200 |
commit | b7dda5ff2d09675918223550f88efe4d4b4ebe5a (patch) | |
tree | 5b728d9ac0eceb7bf8c41aed59c1f8930db7eb0b /controller-api | |
parent | 860265b3e1ae38f0c7857a3254e03f82961144cc (diff) |
Serialise JobType with zone+test, and eliminate last == usages
Diffstat (limited to 'controller-api')
2 files changed, 10 insertions, 5 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobId.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobId.java index 846f3784657..0ef9807270e 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobId.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobId.java @@ -29,7 +29,7 @@ public class JobId { if (o == null || getClass() != o.getClass()) return false; JobId jobId = (JobId) o; return application.equals(jobId.application) && - type == jobId.type; + type.equals(jobId.type); } @Override diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java index e9231f80091..c435ae37c40 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java @@ -255,10 +255,12 @@ public final class JobType implements Comparable<JobType> { return zones.get(system); } + /** A system test in a test zone, or throws if no test zones are present.. */ public static JobType systemTest(ZoneRegistry zones) { return testIn(test, zones); } + /** A staging test in a staging zone, or throws if no staging zones are present. */ public static JobType stagingTest(ZoneRegistry zones){ return testIn(staging, zones); } @@ -268,18 +270,22 @@ public final class JobType implements Comparable<JobType> { .findFirst().orElseThrow(() -> new IllegalArgumentException("no zones in " + environment + " among " + zones.zones().controllerUpgraded().zones())); } + /** A deployment to the given dev region. */ public static JobType dev(String region) { return deploymentTo(ZoneId.from("dev", region)); } + /** A deployment to the given perf region. */ public static JobType perf(String region) { return deploymentTo(ZoneId.from("perf", region)); } + /** A deployment to the given prod region. */ public static JobType prod(String region) { return deploymentTo(ZoneId.from("prod", region)); } + /** A production test in the given region. */ public static JobType test(String region) { return productionTestOf(ZoneId.from("prod", region)); } @@ -311,10 +317,9 @@ public final class JobType implements Comparable<JobType> { throw new IllegalArgumentException("illegal serialized job type '" + raw + "'"); } - // TODO jonmv: use for serialisation - public String serialized() { - throw new UnsupportedOperationException(); - // return zone.environment().value() + "." + zone.region().value() + (isProductionTest ? ".test"); + public String serialized(SystemName system) { + ZoneId zone = zone(system); + return zone.environment().value() + "." + zone.region().value() + (isProductionTest ? ".test" : ""); } public static List<JobType> allIn(ZoneRegistry zones) { |