Search in sources :

Example 1 with VespaConfigChangeAction

use of com.yahoo.vespa.model.application.validation.change.VespaConfigChangeAction in project vespa by vespa-engine.

the class AttributeChangeValidator method validateAttributeSettings.

private List<VespaConfigChangeAction> validateAttributeSettings() {
    List<VespaConfigChangeAction> result = new ArrayList<>();
    for (Attribute nextAttr : nextFields.attributes()) {
        Attribute currAttr = currentFields.getAttribute(nextAttr.getName());
        if (currAttr != null) {
            validateAttributeSetting(currAttr, nextAttr, Attribute::isFastSearch, "fast-search", result);
            validateAttributeSetting(currAttr, nextAttr, Attribute::isFastAccess, "fast-access", result);
            validateAttributeSetting(currAttr, nextAttr, Attribute::isHuge, "huge", result);
            validateAttributeSetting(currAttr, nextAttr, Attribute::densePostingListThreshold, "dense-posting-list-threshold", result);
            validateAttributeSetting(currAttr, nextAttr, Attribute::isEnabledOnlyBitVector, "rank: filter", result);
        }
    }
    return result;
}
Also used : Attribute(com.yahoo.searchdefinition.document.Attribute) ArrayList(java.util.ArrayList) VespaConfigChangeAction(com.yahoo.vespa.model.application.validation.change.VespaConfigChangeAction)

Example 2 with VespaConfigChangeAction

use of com.yahoo.vespa.model.application.validation.change.VespaConfigChangeAction in project vespa by vespa-engine.

the class IndexingScriptChangeValidator method validate.

public List<VespaConfigChangeAction> validate(ValidationOverrides overrides, Instant now) {
    List<VespaConfigChangeAction> result = new ArrayList<>();
    for (SDField nextField : nextSearch.allConcreteFields()) {
        String fieldName = nextField.getName();
        SDField currentField = currentSearch.getConcreteField(fieldName);
        if (currentField != null) {
            validateScripts(currentField, nextField, overrides, now).ifPresent(r -> result.add(r));
        }
    }
    return result;
}
Also used : SDField(com.yahoo.searchdefinition.document.SDField) ArrayList(java.util.ArrayList) VespaConfigChangeAction(com.yahoo.vespa.model.application.validation.change.VespaConfigChangeAction)

Example 3 with VespaConfigChangeAction

use of com.yahoo.vespa.model.application.validation.change.VespaConfigChangeAction in project vespa by vespa-engine.

the class DocumentTypeChangeValidatorTest method requireThatChangingTargetTypeOfReferenceFieldIsNotOK.

@Test
public void requireThatChangingTargetTypeOfReferenceFieldIsNotOK() throws Exception {
    DocumentTypeChangeValidator validator = new DocumentTypeChangeValidator(createDocumentTypeWithReferenceField("oldDoc"), createDocumentTypeWithReferenceField("newDoc"));
    List<VespaConfigChangeAction> result = validator.validate(ValidationOverrides.empty, Instant.now());
    assertEquals(1, result.size());
    VespaConfigChangeAction action = result.get(0);
    assertTrue(action instanceof VespaRefeedAction);
    assertEquals("type='refeed', " + "message='Field 'ref' changed: data type: 'Reference<oldDoc>' -> 'Reference<newDoc>'', " + "services=[], documentType=''", action.toString());
}
Also used : VespaRefeedAction(com.yahoo.vespa.model.application.validation.change.VespaRefeedAction) VespaConfigChangeAction(com.yahoo.vespa.model.application.validation.change.VespaConfigChangeAction) Test(org.junit.Test)

Aggregations

VespaConfigChangeAction (com.yahoo.vespa.model.application.validation.change.VespaConfigChangeAction)3 ArrayList (java.util.ArrayList)2 Attribute (com.yahoo.searchdefinition.document.Attribute)1 SDField (com.yahoo.searchdefinition.document.SDField)1 VespaRefeedAction (com.yahoo.vespa.model.application.validation.change.VespaRefeedAction)1 Test (org.junit.Test)1