diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-03-21 10:51:33 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-03-21 10:51:33 +0100 |
commit | 62b81908c1fd922dcf397e99c4a79f5e73fffcfd (patch) | |
tree | 15ca131f3be20541baea5dbdb6ac948777d96be1 /config-provisioning | |
parent | 5d78b3914b8fe7577a321cff581f4002c1147183 (diff) |
Preserve methods for compatibility
Diffstat (limited to 'config-provisioning')
-rw-r--r-- | config-provisioning/src/main/java/com/yahoo/config/provision/Capacity.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/Capacity.java b/config-provisioning/src/main/java/com/yahoo/config/provision/Capacity.java index e061c5d07ee..299b7282e4a 100644 --- a/config-provisioning/src/main/java/com/yahoo/config/provision/Capacity.java +++ b/config-provisioning/src/main/java/com/yahoo/config/provision/Capacity.java @@ -64,4 +64,34 @@ public final class Capacity { return new Capacity(0, Optional.empty(), true, type); } + /** Creates this from a desired node count: The request may be satisfied with a smaller number of nodes. */ + // TODO: Remove after April 2018 + public static Capacity fromNodeCount(int nodeCount, String flavor) { + return fromNodeCount(nodeCount, Optional.of(flavor)); + } + + /** Creates this from a desired node count: The request may be satisfied with a smaller number of nodes. */ + // TODO: Remove after April 2018 + public static Capacity fromNodeCount(int nodeCount, Optional<String> flavor) { + return new Capacity(nodeCount, flavor, false, NodeType.tenant); + } + + /** Creates this from a required node count: Requests must fail unless the node count can be satisfied exactly */ + // TODO: Remove after April 2018 + public static Capacity fromRequiredNodeCount(int nodeCount) { + return fromRequiredNodeCount(nodeCount, Optional.empty()); + } + + /** Creates this from a required node count: Requests must fail unless the node count can be satisfied exactly */ + // TODO: Remove after April 2018 + public static Capacity fromRequiredNodeCount(int nodeCount, String flavor) { + return fromRequiredNodeCount(nodeCount, Optional.of(flavor)); + } + + /** Creates this from a required node count: Requests must fail unless the node count can be satisfied exactly */ + // TODO: Remove after April 2018 + public static Capacity fromRequiredNodeCount(int nodeCount, Optional<String> flavor) { + return new Capacity(nodeCount, flavor, true, NodeType.tenant); + } + } |