summaryrefslogtreecommitdiffstats
path: root/config-model/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java16
-rw-r--r--config-model/src/main/resources/schema/common.rnc3
2 files changed, 16 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java
index 86c72221cab..c0ce5ca22db 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java
@@ -171,7 +171,8 @@ public class NodesSpecification {
Optional.ofNullable(resources.stringAttribute("bandwidth"))
.map(b -> parseGbAmount(b, "BPS"))
.orElse(0.3),
- parseOptionalDiskSpeed(resources.stringAttribute("disk-speed"))));
+ parseOptionalDiskSpeed(resources.stringAttribute("disk-speed")),
+ parseOptionalStorageType(resources.stringAttribute("storage-type"))));
}
else if (nodesElement.stringAttribute("flavor") != null) { // legacy fallback
return Optional.of(NodeResources.fromLegacyName(nodesElement.stringAttribute("flavor")));
@@ -221,12 +222,23 @@ public class NodesSpecification {
switch (diskSpeedString) {
case "fast" : return NodeResources.DiskSpeed.fast;
case "slow" : return NodeResources.DiskSpeed.slow;
- case "any" : return NodeResources.DiskSpeed.any;
+ case "any" : return NodeResources.DiskSpeed.any;
default: throw new IllegalArgumentException("Illegal disk-speed value '" + diskSpeedString +
"': Legal values are 'fast', 'slow' and 'any')");
}
}
+ private static NodeResources.StorageType parseOptionalStorageType(String storageTypeString) {
+ if (storageTypeString == null) return NodeResources.StorageType.any;
+ switch (storageTypeString) {
+ case "remote" : return NodeResources.StorageType.remote;
+ case "local" : return NodeResources.StorageType.local;
+ case "any" : return NodeResources.StorageType.any;
+ default: throw new IllegalArgumentException("Illegal storage-type value '" + storageTypeString +
+ "': Legal values are 'remote', 'local' and 'any')");
+ }
+ }
+
@Override
public String toString() {
return "specification of " + count + (dedicated ? " dedicated " : " ") + "nodes" +
diff --git a/config-model/src/main/resources/schema/common.rnc b/config-model/src/main/resources/schema/common.rnc
index c5690f9c915..e3ad942e7b3 100644
--- a/config-model/src/main/resources/schema/common.rnc
+++ b/config-model/src/main/resources/schema/common.rnc
@@ -27,7 +27,8 @@ Resources = element resources {
attribute vcpu { xsd:double { minExclusive = "0.0" } } &
attribute memory { xsd:string } &
attribute disk { xsd:string } &
- attribute disk-speed { xsd:string }?
+ attribute disk-speed { xsd:string }? &
+ attribute storage-type { xsd:string }?
}
OptionalDedicatedNodes = element nodes {