diff options
author | Valerij Fredriksen <valerijf@verizonmedia.com> | 2019-06-14 13:45:42 +0200 |
---|---|---|
committer | Valerij Fredriksen <valerijf@verizonmedia.com> | 2019-06-19 17:57:28 +0200 |
commit | fe77e46ff5bbf5c7ec2a0aa450213bb2806576b2 (patch) | |
tree | 0ad8cf90ff05edd6c35359b8b81125c3253f4c87 /config-provisioning/src/main/java/com/yahoo/config/provision/Flavor.java | |
parent | 8d007e3adfe822499b20806a2a92ca55dbda3131 (diff) |
Simplify Flavors
Diffstat (limited to 'config-provisioning/src/main/java/com/yahoo/config/provision/Flavor.java')
-rw-r--r-- | config-provisioning/src/main/java/com/yahoo/config/provision/Flavor.java | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/Flavor.java b/config-provisioning/src/main/java/com/yahoo/config/provision/Flavor.java index 8667707883d..7ecab86529f 100644 --- a/config-provisioning/src/main/java/com/yahoo/config/provision/Flavor.java +++ b/config-provisioning/src/main/java/com/yahoo/config/provision/Flavor.java @@ -5,10 +5,8 @@ import com.google.common.collect.ImmutableList; import com.yahoo.config.provisioning.FlavorsConfig; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Objects; -import java.util.Optional; /** * A host or node flavor. @@ -29,7 +27,6 @@ public class Flavor { private final String description; private final boolean retired; private List<Flavor> replacesFlavors; - private int idealHeadroom; // Note: Not used after Vespa 6.282 /** The hardware resources of this flavor */ private NodeResources resources; @@ -49,7 +46,6 @@ public class Flavor { this.description = flavorConfig.description(); this.retired = flavorConfig.retired(); this.replacesFlavors = new ArrayList<>(); - this.idealHeadroom = flavorConfig.idealHeadroom(); } /** Creates a *node* flavor from a node resources spec */ @@ -66,8 +62,7 @@ public class Flavor { this.bandwidth = 1; this.description = ""; this.retired = false; - this.replacesFlavors = Collections.emptyList(); - this.idealHeadroom = 0; + this.replacesFlavors = List.of(); this.resources = resources; } @@ -114,11 +109,6 @@ public class Flavor { /** Convenience, returns getType() == Type.DOCKER_CONTAINER */ public boolean isDocker() { return type == Type.DOCKER_CONTAINER; } - /** The free capacity we would like to preserve for this flavor */ - public int getIdealHeadroom() { - return idealHeadroom; - } - /** * Returns the canonical name of this flavor - which is the name which should be used as an interface to users. * The canonical name of this flavor is: @@ -164,23 +154,10 @@ public class Flavor { return false; } - /** - * Returns whether this flavor has at least the given resources, i.e if all resources of this are at least - * as large as the given resources. - */ - public boolean hasAtLeast(NodeResources resources) { - return this.resources.satisfies(resources); - } - /** Irreversibly freezes the content of this */ public void freeze() { replacesFlavors = ImmutableList.copyOf(replacesFlavors); } - - /** Returns whether this flavor has at least as much of each hardware resource as the given flavor */ - public boolean isLargerThan(Flavor other) { - return hasAtLeast(other.resources); - } @Override public int hashCode() { return name.hashCode(); } |