diff options
author | Jon Bratseth <bratseth@gmail.com> | 2023-03-10 15:20:11 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2023-03-10 15:20:11 +0100 |
commit | 3881033cffca4d8461c076e26717d9493c3bac13 (patch) | |
tree | c89d86519b76fbb08932c7e9caa4b61d7938ce85 /node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications | |
parent | ce7bcde58f5a8b80d631a11f6b19c13c36c72450 (diff) |
Don't rescale if there is an incomplete rescaling
Diffstat (limited to 'node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications')
2 files changed, 6 insertions, 2 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java index 16016815b7c..6a81c17d362 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java @@ -122,6 +122,11 @@ public class Cluster { return Optional.of(scalingEvents.get(scalingEvents.size() - 1)); } + /** Returns whether the last scaling event in this has yet to complete. */ + public boolean scalingInProgress() { + return lastScalingEvent().isPresent() && lastScalingEvent().get().completion().isEmpty(); + } + public Cluster withConfiguration(boolean exclusive, Capacity capacity) { return new Cluster(id, exclusive, capacity.minResources(), capacity.maxResources(), capacity.groupSize(), capacity.isRequired(), diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/ScalingEvent.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/ScalingEvent.java index e88989514c4..91270f14fbb 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/ScalingEvent.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/ScalingEvent.java @@ -64,8 +64,7 @@ public class ScalingEvent { @Override public boolean equals(Object o) { if (o == this) return true; - if ( ! (o instanceof ScalingEvent)) return true; - ScalingEvent other = (ScalingEvent)o; + if ( ! (o instanceof ScalingEvent other)) return true; if ( other.generation != this.generation) return false; if ( ! other.at.equals(this.at)) return false; if ( ! other.from.equals(this.from)) return false; |