diff options
author | Martin Polden <mpolden@mpolden.no> | 2019-02-06 14:06:06 +0100 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2019-02-06 14:40:04 +0100 |
commit | 6186a7b215fecda94d2e9e47de3b800ed4452f82 (patch) | |
tree | 80f22bd75a1edcd1a2fb2a403acabeaba221ea87 /controller-api | |
parent | 8adc7d48476437d33c910e46a6da85d36acedebe (diff) |
Add rotations to routing policy
Diffstat (limited to 'controller-api')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java index 012cc3df7f1..ec5321cb3b6 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/LoadBalancer.java @@ -1,11 +1,14 @@ // Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.configserver; +import com.google.common.collect.ImmutableSortedSet; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.HostName; +import com.yahoo.config.provision.RotationName; import java.util.Objects; +import java.util.Set; /** * Represents an exclusive load balancer, assigned to an application's cluster. @@ -18,12 +21,14 @@ public class LoadBalancer { private final ApplicationId application; private final ClusterSpec.Id cluster; private final HostName hostname; + private final Set<RotationName> rotations; - public LoadBalancer(String id, ApplicationId application, ClusterSpec.Id cluster, HostName hostname) { + public LoadBalancer(String id, ApplicationId application, ClusterSpec.Id cluster, HostName hostname, Set<RotationName> rotations) { this.id = Objects.requireNonNull(id, "id must be non-null"); this.application = Objects.requireNonNull(application, "application must be non-null"); this.cluster = Objects.requireNonNull(cluster, "cluster must be non-null"); this.hostname = Objects.requireNonNull(hostname, "hostname must be non-null"); + this.rotations = ImmutableSortedSet.copyOf(Objects.requireNonNull(rotations, "rotations must be non-null")); } public String id() { @@ -42,4 +47,8 @@ public class LoadBalancer { return hostname; } + public Set<RotationName> rotations() { + return rotations; + } + } |