From a0ffdbc4e99c737323395f50249a4f76918198b4 Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Fri, 18 Mar 2022 06:48:24 +0100 Subject: Consider architecture when calculating with NodeResources --- .../main/java/com/yahoo/config/provision/NodeResources.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'config-provisioning') 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; } -- cgit v1.2.3