diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-05-07 21:10:23 +0200 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-05-09 11:18:39 +0200 |
commit | f3181bc95684341d3a9ea94edb025115c5af5ca3 (patch) | |
tree | 80608ee1022e154e85df599b719bb0f61a8cb4c0 /controller-api/src | |
parent | 02e883daacb9aac085d18d848395cad568373a17 (diff) |
Re-format JobType enum definition for more system and readability
Diffstat (limited to 'controller-api/src')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java | 82 |
1 files changed, 59 insertions, 23 deletions
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 f2334d01716..c04527c0c4d 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 @@ -7,40 +7,76 @@ import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.SystemName; import com.yahoo.config.provision.zone.ZoneId; +import java.util.Map; import java.util.Optional; import java.util.stream.Stream; +import static com.yahoo.config.provision.SystemName.cd; +import static com.yahoo.config.provision.SystemName.main; + /** Job types that exist in the build system */ public enum JobType { // | enum name ------------| job name ------------------| Zone in main system ---------------------------------------| Zone in CD system ------------------------------------------- - component ("component" , null , null ), - systemTest ("system-test" , ZoneId.from("test" , "us-east-1") , ZoneId.from("test" , "cd-us-central-1") ), - stagingTest ("staging-test" , ZoneId.from("staging", "us-east-3") , ZoneId.from("staging", "cd-us-central-1") ), - productionUsEast3 ("production-us-east-3" , ZoneId.from("prod" , "us-east-3") , null ), - productionUsWest1 ("production-us-west-1" , ZoneId.from("prod" , "us-west-1") , null ), - productionUsCentral1 ("production-us-central-1" , ZoneId.from("prod" , "us-central-1") , null ), - productionApNortheast1 ("production-ap-northeast-1" , ZoneId.from("prod" , "ap-northeast-1") , null ), - productionApNortheast2 ("production-ap-northeast-2" , ZoneId.from("prod" , "ap-northeast-2") , null ), - productionApSoutheast1 ("production-ap-southeast-1" , ZoneId.from("prod" , "ap-southeast-1") , null ), - productionEuWest1 ("production-eu-west-1" , ZoneId.from("prod" , "eu-west-1") , null ), - productionAwsUsEast1a ("production-aws-us-east-1a" , ZoneId.from("prod" , "aws-us-east-1a") , null ), - productionAwsUsWest2a ("production-aws-us-west-2a" , ZoneId.from("prod" , "aws-us-west-2a") , null ), - productionAwsUsEast1b ("production-aws-us-east-1b" , ZoneId.from("prod" , "aws-us-east-1b") , null ), - productionCdAwsUsEast1a("production-cd-aws-us-east-1a", null , ZoneId.from("prod" , "cd-aws-us-east-1a")), - productionCdUsCentral1 ("production-cd-us-central-1" , null , ZoneId.from("prod" , "cd-us-central-1") ), + component ("component", + Map.of()), + + systemTest ("system-test", + Map.of(main, ZoneId.from("test" , "us-east-1"), + cd , ZoneId.from("test" , "cd-us-central-1"))), + + stagingTest ("staging-test", + Map.of(main, ZoneId.from("staging", "us-east-3"), + cd , ZoneId.from("staging", "cd-us-central-1"))), + + productionUsEast3 ("production-us-east-3", + Map.of(main, ZoneId.from("prod" , "us-east-3"))), + + productionUsWest1 ("production-us-west-1", + Map.of(main, ZoneId.from("prod" , "us-west-1"))), + + productionUsCentral1 ("production-us-central-1", + Map.of(main, ZoneId.from("prod" , "us-central-1"))), + + productionApNortheast1 ("production-ap-northeast-1", + Map.of(main, ZoneId.from("prod" , "ap-northeast-1"))), + + productionApNortheast2 ("production-ap-northeast-2", + Map.of(main, ZoneId.from("prod" , "ap-northeast-2"))), + + productionApSoutheast1 ("production-ap-southeast-1", + Map.of(main, ZoneId.from("prod" , "ap-southeast-1"))), + + productionEuWest1 ("production-eu-west-1", + Map.of(main, ZoneId.from("prod" , "eu-west-1"))), + + productionAwsUsEast1a ("production-aws-us-east-1a", + Map.of(main, ZoneId.from("prod" , "aws-us-east-1a"))), + + productionAwsUsWest2a ("production-aws-us-west-2a", + Map.of(main, ZoneId.from("prod" , "aws-us-west-2a"))), + + productionAwsUsEast1b ("production-aws-us-east-1b", + Map.of(main, ZoneId.from("prod" , "aws-us-east-1b"))), + + productionCdAwsUsEast1a("production-cd-aws-us-east-1a", + Map.of(cd , ZoneId.from("prod" , "cd-aws-us-east-1a"))), + + productionCdUsCentral1 ("production-cd-us-central-1", + Map.of(cd , ZoneId.from("prod" , "cd-us-central-1"))), + // TODO: Cannot remove production-cd-us-central-2 until we know there are no serialized data in controller referencing it - productionCdUsCentral2 ("production-cd-us-central-2" , null , ZoneId.from("prod" , "cd-us-central-2") ), - productionCdUsWest1 ("production-cd-us-west-1" , null , ZoneId.from("prod" , "cd-us-west-1") ); + productionCdUsCentral2 ("production-cd-us-central-2", + Map.of(cd , ZoneId.from("prod" , "cd-us-central-2"))), + + productionCdUsWest1 ("production-cd-us-west-1", + Map.of(cd , ZoneId.from("prod" , "cd-us-west-1"))); private final String jobName; - private final ImmutableMap<SystemName, ZoneId> zones; + private final Map<SystemName, ZoneId> zones; - JobType(String jobName, ZoneId mainZone, ZoneId cdZone) { + JobType(String jobName, Map<SystemName, ZoneId> zones) { this.jobName = jobName; - ImmutableMap.Builder<SystemName, ZoneId> builder = ImmutableMap.builder(); - if (mainZone != null) builder.put(SystemName.main, mainZone); - if (cdZone != null) builder.put(SystemName.cd, cdZone); - this.zones = builder.build(); + this.zones = zones; } public String jobName() { return jobName; } |