diff options
author | Harald Musum <musum@yahooinc.com> | 2022-03-18 06:48:24 +0100 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2022-03-18 06:48:24 +0100 |
commit | a0ffdbc4e99c737323395f50249a4f76918198b4 (patch) | |
tree | ad2e8bf3e6d1676ff4737b15dc63b19cfc1bcfec /config-provisioning/src | |
parent | 9457a53d04f774a40853401a24659e8f992fb5ea (diff) |
Consider architecture when calculating with NodeResources
Diffstat (limited to 'config-provisioning/src')
-rw-r--r-- | config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java b/config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java index 8fcdebc5d97..21349910ca1 100644 --- a/config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java +++ b/config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java @@ -208,7 +208,7 @@ public class NodeResources { /** Returns this with disk speed and storage type set to any */ public NodeResources justNumbers() { if (isUnspecified()) return unspecified(); - return with(NodeResources.DiskSpeed.any).with(StorageType.any); + return with(NodeResources.DiskSpeed.any).with(StorageType.any).with(Architecture.any); } /** Returns this with all numbers set to 0 */ @@ -227,7 +227,8 @@ public class NodeResources { diskGb - other.diskGb, bandwidthGbps - other.bandwidthGbps, this.diskSpeed.combineWith(other.diskSpeed), - this.storageType.combineWith(other.storageType)); + this.storageType.combineWith(other.storageType), + this.architecture.combineWith(other.architecture)); } public NodeResources add(NodeResources other) { @@ -239,7 +240,8 @@ public class NodeResources { diskGb + other.diskGb, bandwidthGbps + other.bandwidthGbps, this.diskSpeed.combineWith(other.diskSpeed), - this.storageType.combineWith(other.storageType)); + this.storageType.combineWith(other.storageType), + this.architecture.combineWith(other.architecture)); } private boolean isInterchangeableWith(NodeResources other) { @@ -249,6 +251,8 @@ public class NodeResources { return false; if (this.storageType != StorageType.any && other.storageType != StorageType.any && this.storageType != other.storageType) return false; + if (this.architecture != Architecture.any && other.architecture != Architecture.any && this.architecture != other.architecture) + return false; return true; } |