diff options
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java index 4fd5e82e93f..b66145a10c5 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.application.validation.change.search; +import com.yahoo.config.provision.ClusterSpec; import com.yahoo.document.StructDataType; import com.yahoo.documentmodel.NewDocumentType; import com.yahoo.document.Field; @@ -16,12 +17,12 @@ import java.util.stream.Collectors; * Validates the changes between a current and next document type used in a document database. * * @author toregge - * @since 2014-11-25 */ public class DocumentTypeChangeValidator { - private NewDocumentType currentDocType; - private NewDocumentType nextDocType; + private final ClusterSpec.Id id; + private final NewDocumentType currentDocType; + private final NewDocumentType nextDocType; private static abstract class FieldChange { @@ -127,8 +128,10 @@ public class DocumentTypeChangeValidator { } } - public DocumentTypeChangeValidator(NewDocumentType currentDocType, + public DocumentTypeChangeValidator(ClusterSpec.Id id, + NewDocumentType currentDocType, NewDocumentType nextDocType) { + this.id = id; this.currentDocType = currentDocType; this.nextDocType = nextDocType; } @@ -137,7 +140,8 @@ public class DocumentTypeChangeValidator { return currentDocType.getAllFields().stream(). map(field -> createFieldChange(field, nextDocType)). filter(fieldChange -> fieldChange.valid() && fieldChange.changedType()). - map(fieldChange -> VespaRefeedAction.of("field-type-change", + map(fieldChange -> VespaRefeedAction.of(id, + "field-type-change", overrides, new ChangeMessageBuilder(fieldChange.fieldName()). addChange("data type", fieldChange.currentTypeName(), |