summaryrefslogtreecommitdiffstats
path: root/config-provisioning
diff options
context:
space:
mode:
authorValerij Fredriksen <valerijf@verizonmedia.com>2019-08-20 13:13:00 +0200
committerValerij Fredriksen <valerijf@verizonmedia.com>2019-08-20 16:43:59 +0200
commitba6f25d4e5196feb5cb0f37a1c5c75cf8b09959d (patch)
treee7d660d9780c051bc52fa623c12310636cb5197f /config-provisioning
parent27106bb4a50f319a1d2d7418eef730e7b012dde2 (diff)
bandwidthMbps -> bandwidthGbps
Diffstat (limited to 'config-provisioning')
-rw-r--r--config-provisioning/abi-spec.json4
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/Flavor.java4
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java26
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/serialization/AllocatedHostsSerializer.java2
4 files changed, 18 insertions, 18 deletions
diff --git a/config-provisioning/abi-spec.json b/config-provisioning/abi-spec.json
index 70e86c7b097..c249e113379 100644
--- a/config-provisioning/abi-spec.json
+++ b/config-provisioning/abi-spec.json
@@ -397,7 +397,7 @@
"public double getMinMainMemoryAvailableGb()",
"public double getMinDiskAvailableGb()",
"public boolean hasFastDisk()",
- "public double getBandwidth()",
+ "public double getBandwidthGbps()",
"public double getMinCpuCores()",
"public boolean isRetired()",
"public com.yahoo.config.provision.Flavor$Type getType()",
@@ -612,7 +612,7 @@
"public double vcpu()",
"public double memoryGb()",
"public double diskGb()",
- "public double bandwidthMbps()",
+ "public double bandwidthGbps()",
"public com.yahoo.config.provision.NodeResources$DiskSpeed diskSpeed()",
"public com.yahoo.config.provision.NodeResources withDiskSpeed(com.yahoo.config.provision.NodeResources$DiskSpeed)",
"public com.yahoo.config.provision.NodeResources withVcpu(double)",
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 fd0fe724809..bf8e75ebebc 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
@@ -33,7 +33,7 @@ public class Flavor {
this.resources = new NodeResources(flavorConfig.minCpuCores(),
flavorConfig.minMainMemoryAvailableGb(),
flavorConfig.minDiskAvailableGb(),
- flavorConfig.bandwidth(),
+ flavorConfig.bandwidth() / 1000,
flavorConfig.fastDisk() ? NodeResources.DiskSpeed.fast : NodeResources.DiskSpeed.slow);
}
@@ -72,7 +72,7 @@ public class Flavor {
public boolean hasFastDisk() { return resources.diskSpeed() == NodeResources.DiskSpeed.fast; }
- public double getBandwidth() { return resources.bandwidthMbps(); }
+ public double getBandwidthGbps() { return resources.bandwidthGbps(); }
public double getMinCpuCores() { return resources.vcpu(); }
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 3a945a95812..785b3f21ed5 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
@@ -20,7 +20,7 @@ public class NodeResources {
private final double vcpu;
private final double memoryGb;
private final double diskGb;
- private final double bandwidthMbps;
+ private final double bandwidthGbps;
private final DiskSpeed diskSpeed;
/** Create node resources requiring fast disk and no bandwidth */
@@ -33,26 +33,26 @@ public class NodeResources {
this(vcpu, memoryGb, diskGb, 0, diskSpeed);
}
- public NodeResources(double vcpu, double memoryGb, double diskGb, double bandwidthMbps, DiskSpeed diskSpeed) {
+ public NodeResources(double vcpu, double memoryGb, double diskGb, double bandwidthGbps, DiskSpeed diskSpeed) {
this.vcpu = vcpu;
this.memoryGb = memoryGb;
this.diskGb = diskGb;
- this.bandwidthMbps = bandwidthMbps;
+ this.bandwidthGbps = bandwidthGbps;
this.diskSpeed = diskSpeed;
}
public double vcpu() { return vcpu; }
public double memoryGb() { return memoryGb; }
public double diskGb() { return diskGb; }
- public double bandwidthMbps() { return bandwidthMbps; }
+ public double bandwidthGbps() { return bandwidthGbps; }
public DiskSpeed diskSpeed() { return diskSpeed; }
public NodeResources withDiskSpeed(DiskSpeed speed) {
- return new NodeResources(vcpu, memoryGb, diskGb, bandwidthMbps, speed);
+ return new NodeResources(vcpu, memoryGb, diskGb, bandwidthGbps, speed);
}
public NodeResources withVcpu(double vcpu) {
- return new NodeResources(vcpu, memoryGb, diskGb, bandwidthMbps, diskSpeed);
+ return new NodeResources(vcpu, memoryGb, diskGb, bandwidthGbps, diskSpeed);
}
public NodeResources subtract(NodeResources other) {
@@ -61,7 +61,7 @@ public class NodeResources {
return new NodeResources(vcpu - other.vcpu,
memoryGb - other.memoryGb,
diskGb - other.diskGb,
- bandwidthMbps - other.bandwidthMbps,
+ bandwidthGbps - other.bandwidthGbps,
combine(this.diskSpeed, other.diskSpeed));
}
@@ -71,7 +71,7 @@ public class NodeResources {
return new NodeResources(vcpu + other.vcpu,
memoryGb + other.memoryGb,
diskGb + other.diskGb,
- bandwidthMbps + other.bandwidthMbps,
+ bandwidthGbps + other.bandwidthGbps,
combine(this.diskSpeed, other.diskSpeed));
}
@@ -104,20 +104,20 @@ public class NodeResources {
if (this.vcpu != other.vcpu) return false;
if (this.memoryGb != other.memoryGb) return false;
if (this.diskGb != other.diskGb) return false;
- if (this.bandwidthMbps != other.bandwidthMbps) return false;
+ if (this.bandwidthGbps != other.bandwidthGbps) return false;
if (this.diskSpeed != other.diskSpeed) return false;
return true;
}
@Override
public int hashCode() {
- return Objects.hash(vcpu, memoryGb, diskGb, bandwidthMbps, diskSpeed);
+ return Objects.hash(vcpu, memoryGb, diskGb, bandwidthGbps, diskSpeed);
}
@Override
public String toString() {
return "[vcpu: " + vcpu + ", memory: " + memoryGb + " Gb, disk " + diskGb + " Gb" +
- (bandwidthMbps > 0 ? ", bandwidth: " + bandwidthMbps + " Mbps" : "") +
+ (bandwidthGbps > 0 ? ", bandwidth: " + bandwidthGbps + " Gbps" : "") +
(diskSpeed != DiskSpeed.fast ? ", disk speed: " + diskSpeed : "") + "]";
}
@@ -126,7 +126,7 @@ public class NodeResources {
if (this.vcpu < other.vcpu) return false;
if (this.memoryGb < other.memoryGb) return false;
if (this.diskGb < other.diskGb) return false;
- if (this.bandwidthMbps < other.bandwidthMbps) return false;
+ if (this.bandwidthGbps < other.bandwidthGbps) return false;
// Why doesn't a fast disk satisfy a slow disk? Because if slow disk is explicitly specified
// (i.e not "any"), you should not randomly, sometimes get a faster disk as that means you may
@@ -141,7 +141,7 @@ public class NodeResources {
if (this.vcpu != other.vcpu) return false;
if (this.memoryGb != other.memoryGb) return false;
if (this.diskGb != other.diskGb) return false;
- if (this.bandwidthMbps != other.bandwidthMbps) return false;
+ if (this.bandwidthGbps != other.bandwidthGbps) return false;
if (other.diskSpeed != DiskSpeed.any && other.diskSpeed != this.diskSpeed) return false;
return true;
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/serialization/AllocatedHostsSerializer.java b/config-provisioning/src/main/java/com/yahoo/config/provision/serialization/AllocatedHostsSerializer.java
index 54c8e6c6ccf..4462862b1f3 100644
--- a/config-provisioning/src/main/java/com/yahoo/config/provision/serialization/AllocatedHostsSerializer.java
+++ b/config-provisioning/src/main/java/com/yahoo/config/provision/serialization/AllocatedHostsSerializer.java
@@ -104,7 +104,7 @@ public class AllocatedHostsSerializer {
resourcesObject.setDouble(vcpuKey, resources.vcpu());
resourcesObject.setDouble(memoryKey, resources.memoryGb());
resourcesObject.setDouble(diskKey, resources.diskGb());
- resourcesObject.setDouble(bandwidthKey, resources.bandwidthMbps());
+ resourcesObject.setDouble(bandwidthKey, resources.bandwidthGbps());
resourcesObject.setString(diskSpeedKey, diskSpeedToString(resources.diskSpeed()));
}
}