Search in sources :

Example 1 with ResourceLimits

use of com.yahoo.vespa.model.content.ResourceLimits in project vespa by vespa-engine.

the class DomResourceLimitsBuilder method build.

public static ResourceLimits build(ModelElement contentXml) {
    ResourceLimits.Builder builder = new ResourceLimits.Builder();
    ModelElement resourceLimits = contentXml.getChild("resource-limits");
    if (resourceLimits == null) {
        return builder.build();
    }
    if (resourceLimits.getChild("disk") != null) {
        builder.setDiskLimit(resourceLimits.childAsDouble("disk"));
    }
    if (resourceLimits.getChild("memory") != null) {
        builder.setMemoryLimit(resourceLimits.childAsDouble("memory"));
    }
    return builder.build();
}
Also used : ModelElement(com.yahoo.vespa.model.builder.xml.dom.ModelElement) ResourceLimits(com.yahoo.vespa.model.content.ResourceLimits)

Aggregations

ModelElement (com.yahoo.vespa.model.builder.xml.dom.ModelElement)1 ResourceLimits (com.yahoo.vespa.model.content.ResourceLimits)1