diff options
Diffstat (limited to 'config-model/src/main/java/com')
4 files changed, 8 insertions, 44 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/processing/multifieldresolver/RankTypeResolver.java b/config-model/src/main/java/com/yahoo/schema/processing/multifieldresolver/RankTypeResolver.java index 6424fd8ba06..e86ac6dabfc 100644 --- a/config-model/src/main/java/com/yahoo/schema/processing/multifieldresolver/RankTypeResolver.java +++ b/config-model/src/main/java/com/yahoo/schema/processing/multifieldresolver/RankTypeResolver.java @@ -11,7 +11,7 @@ import java.util.logging.Level; /** * Checks if fields have defined different rank types for the same - * index (typically in an index-to statement), and if they have + * index (typically in a fieldset statement), and if they have * output a warning and use the first ranktype. * * @author hmusum diff --git a/config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java b/config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java index 00a1078b294..098d917c4e0 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java @@ -161,6 +161,11 @@ public class HostSystem extends TreeConfigProducer<Host> { deployLogger.log(level, message); } + @Override + public void logApplicationPackage(Level level, String message) { + deployLogger.logApplicationPackage(level, message); + } + } } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidator.java index df3cd4103d9..92c9eccf2d3 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidator.java @@ -112,9 +112,8 @@ public class ConstantTensorJsonValidator { consumeTopObject(); return; } else if (isScalar()) { - if (top == JsonToken.VALUE_NUMBER_FLOAT || top == JsonToken.VALUE_NUMBER_INT) { - return; - } + throw new InvalidConstantTensorException( + parser, String.format("Invalid type %s: Only tensors with dimensions can be stored as file constants", tensorType.toString())); } throw new InvalidConstantTensorException( parser, String.format("Unexpected first token '%s' for constant with type %s", @@ -315,14 +314,6 @@ public class ConstantTensorJsonValidator { } } - private void assertFieldNameIs(String wantedFieldName) throws IOException { - String actualFieldName = parser.getCurrentName(); - - if (!actualFieldName.equals(wantedFieldName)) { - throw new InvalidConstantTensorException(parser, String.format("Expected field name '%s', got '%s'", wantedFieldName, actualFieldName)); - } - } - static class InvalidConstantTensorException extends IllegalArgumentException { InvalidConstantTensorException(JsonParser parser, String message) { @@ -338,19 +329,6 @@ public class ConstantTensorJsonValidator { } } - @FunctionalInterface - private interface SubroutineThrowingIOException { - void invoke() throws IOException; - } - - private void wrapIOException(SubroutineThrowingIOException lambda) { - try { - lambda.invoke(); - } catch (IOException e) { - throw new InvalidConstantTensorException(parser, e); - } - } - private void consumeValuesNesting(int level) throws IOException { assertCurrentTokenIs(JsonToken.START_ARRAY); if (level >= denseDims.size()) { 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 5bb73643de5..ea4988f3029 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 @@ -290,28 +290,9 @@ public class NodesSpecification { .loadBalancerSettings(zoneEndpoint) .stateful(stateful) .build(); - logInsufficientDiskResources(clusterId, clusterType, logger); return hostSystem.allocateHosts(cluster, Capacity.from(min, max, groupSize, required, canFail, cloudAccount, info), logger); } - /** Log a message if requested disk may not fit core/heap dumps */ - private void logInsufficientDiskResources(ClusterSpec.Id clusterId, ClusterSpec.Type clusterType, DeployLogger deployLogger) { - NodeResources resources = min.nodeResources(); - if (resources.diskGbIsUnspecified() || resources.memoryGbIsUnspecified()) return; - double minDiskGb = resources.memoryGb() * switch (clusterType) { - case combined, content -> 3; - case container -> 2; - default -> 0; // No constraint on other types - }; - if (resources.diskGb() < minDiskGb) { - // TODO(mpolden): Consider enforcing this on Vespa 9 - deployLogger.logApplicationPackage(Level.WARNING, "Requested disk (" + resources.diskGb() + - "Gb) in " + clusterId + " is not large enough to fit " + - "core/heap dumps. Minimum recommended disk resources " + - "is " + minDiskGb + "Gb"); - } - } - private static Pair<NodeResources, NodeResources> nodeResources(ModelElement nodesElement) { ModelElement resources = nodesElement.child("resources"); if (resources != null) { |