diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-04-07 15:00:26 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2021-04-07 16:54:14 +0200 |
commit | fc6977d6555eece6abf92d9a92f100aedd04c3a8 (patch) | |
tree | 9702b0f46c384450052e784cc84ab5090d0095c8 /node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java | |
parent | 335222fd6bb3d020ecc0deb06dc566128bb1648a (diff) |
Add wantToRebuild field
Diffstat (limited to 'node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java')
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java index 1f4bd55525d..80dfafb5116 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java @@ -199,9 +199,20 @@ public final class Node implements Nodelike { * If both given wantToRetire and wantToDeprovision are equal to the current values, the method is no-op. */ public Node withWantToRetire(boolean wantToRetire, boolean wantToDeprovision, Agent agent, Instant at) { + return withWantToRetire(wantToRetire, wantToDeprovision, false, agent, at); + } + + /** + * Returns a copy of this node with wantToRetire, wantToDeprovision and wantToRebuild set to the given values + * and updated history. + * + * If all given values are equal to the current ones, the method is no-op. + */ + public Node withWantToRetire(boolean wantToRetire, boolean wantToDeprovision, boolean wantToRebuild, Agent agent, Instant at) { if (wantToRetire == status.wantToRetire() && - wantToDeprovision == status.wantToDeprovision()) return this; - Node node = this.with(status.withWantToRetire(wantToRetire, wantToDeprovision)); + wantToDeprovision == status.wantToDeprovision() && + wantToRebuild == status.wantToRebuild()) return this; + Node node = this.with(status.withWantToRetire(wantToRetire, wantToDeprovision, wantToRebuild)); if (wantToRetire) node = node.with(history.with(new History.Event(History.Event.Type.wantToRetire, agent, at))); return node; |