diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-11-04 22:13:02 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2020-11-04 22:13:02 +0100 |
commit | bf20b55ec384aac5810dc7dcc1ba2653328730ce (patch) | |
tree | 12cc945aaf397129a292f1d6e4c01e7285cdbebb /node-repository | |
parent | 318f9e54453f4fa5e8e0337f2054bd0fc309906e (diff) |
Add javadoc
Diffstat (limited to 'node-repository')
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java index bc13118c5ec..e87109200df 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java @@ -120,7 +120,7 @@ public class Autoscaler { return false; } - + public static class Advice { private final boolean present; @@ -131,13 +131,21 @@ public class Autoscaler { this.present = present; } + /** + * Returns the autoscaling target that should be set by this advice. + * This is empty if the advice is to keep the current allocation. + */ public Optional<ClusterResources> target() { return target; } + + /** True if this does not provide any advice */ public boolean isEmpty() { return ! present; } + + /** True if this provides advice (which may be to keep the current allocation) */ public boolean isPresent() { return present; } - public static Advice none() { return new Advice(Optional.empty(), false); } - public static Advice dontScale() { return new Advice(Optional.empty(), true); } - public static Advice scaleTo(ClusterResources target) { return new Advice(Optional.of(target), true); } + private static Advice none() { return new Advice(Optional.empty(), false); } + private static Advice dontScale() { return new Advice(Optional.empty(), true); } + private static Advice scaleTo(ClusterResources target) { return new Advice(Optional.of(target), true); } } |