Search in sources :

Example 1 with InvalidConstantTensor

use of com.yahoo.vespa.model.application.validation.ConstantTensorJsonValidator.InvalidConstantTensor in project vespa by vespa-engine.

the class RankingConstantsValidator method validate.

@Override
public void validate(VespaModel model, DeployState deployState) {
    ApplicationPackage applicationPackage = deployState.getApplicationPackage();
    ExceptionMessageCollector exceptionMessageCollector = new ExceptionMessageCollector("Invalid constant tensor file(s):");
    for (SearchDefinition sd : deployState.getSearchDefinitions()) {
        for (RankingConstant rc : sd.getSearch().getRankingConstants().values()) {
            try {
                validateRankingConstant(rc, applicationPackage);
            } catch (InvalidConstantTensor | FileNotFoundException ex) {
                exceptionMessageCollector.add(ex, rc.getName(), rc.getFileName());
            }
        }
    }
    if (exceptionMessageCollector.exceptionsOccurred) {
        throw new TensorValidationFailed(exceptionMessageCollector.combinedMessage);
    }
}
Also used : FileNotFoundException(java.io.FileNotFoundException) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) FilesApplicationPackage(com.yahoo.config.model.application.provider.FilesApplicationPackage) SearchDefinition(com.yahoo.vespa.model.search.SearchDefinition) RankingConstant(com.yahoo.searchdefinition.RankingConstant) InvalidConstantTensor(com.yahoo.vespa.model.application.validation.ConstantTensorJsonValidator.InvalidConstantTensor)

Aggregations

ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)1 FilesApplicationPackage (com.yahoo.config.model.application.provider.FilesApplicationPackage)1 RankingConstant (com.yahoo.searchdefinition.RankingConstant)1 InvalidConstantTensor (com.yahoo.vespa.model.application.validation.ConstantTensorJsonValidator.InvalidConstantTensor)1 SearchDefinition (com.yahoo.vespa.model.search.SearchDefinition)1 FileNotFoundException (java.io.FileNotFoundException)1