aboutsummaryrefslogtreecommitdiffstats
path: root/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2023-03-10 15:20:11 +0100
committerJon Bratseth <bratseth@gmail.com>2023-03-10 15:20:11 +0100
commit3881033cffca4d8461c076e26717d9493c3bac13 (patch)
treec89d86519b76fbb08932c7e9caa4b61d7938ce85 /node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications
parentce7bcde58f5a8b80d631a11f6b19c13c36c72450 (diff)
Don't rescale if there is an incomplete rescaling
Diffstat (limited to 'node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java5
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/ScalingEvent.java3
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;