diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2019-10-09 14:09:49 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2019-10-21 08:08:11 +0200 |
commit | 9661ecfd34d5185c19ef92bbd1053b2e72b81415 (patch) | |
tree | c8a8bf36a18fc34e249e30300c27ad0261a2eac4 /controller-server | |
parent | 68c85e6ca6936072aa69780a2eac369c12c9be98 (diff) |
Assign rotations per instance
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java index e3d8dd092e5..701acd3ddd2 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java @@ -129,17 +129,20 @@ public class RotationRepository { } Map<EndpointId, AssignedRotation> existingAssignments = existingEndpointAssignments(deploymentSpec, instance); - Map<EndpointId, AssignedRotation> updatedAssignments = assignRotationsToEndpoints(deploymentSpec, existingAssignments, lock); + Map<EndpointId, AssignedRotation> updatedAssignments = assignRotationsToEndpoints(deploymentSpec, existingAssignments, instance.name(), lock); existingAssignments.putAll(updatedAssignments); return List.copyOf(existingAssignments.values()); } - private Map<EndpointId, AssignedRotation> assignRotationsToEndpoints(DeploymentSpec deploymentSpec, Map<EndpointId, AssignedRotation> existingAssignments, RotationLock lock) { + private Map<EndpointId, AssignedRotation> assignRotationsToEndpoints(DeploymentSpec deploymentSpec, + Map<EndpointId, AssignedRotation> existingAssignments, + InstanceName instance, + RotationLock lock) { var availableRotations = new ArrayList<>(availableRotations(lock).values()); - var neededRotations = deploymentSpec.endpoints().stream() + var neededRotations = deploymentSpec.requireInstance(instance).endpoints().stream() .filter(Predicate.not(endpoint -> existingAssignments.containsKey(EndpointId.of(endpoint.endpointId())))) .collect(Collectors.toSet()); |