diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2019-12-12 12:25:53 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2019-12-12 12:25:53 +0100 |
commit | 2ca6bcd349163c12e4105c2b77cbf5a09b32702e (patch) | |
tree | 9e061055f5b9fe220bd35c766b66c65b24f104ac /config-model | |
parent | fd90e66adf12ecfa94e55295e2d9657274d952d3 (diff) |
Update config change validator to require restart (and not refeed) when adding
attribute aspect to a struct field.
Diffstat (limited to 'config-model')
3 files changed, 11 insertions, 14 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidator.java index 4dfeb808e31..e3f9610d0a4 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidator.java @@ -12,7 +12,7 @@ import com.yahoo.searchdefinition.derived.AttributeFields; import com.yahoo.searchdefinition.document.Attribute; import com.yahoo.searchdefinition.document.ComplexAttributeFieldUtils; import com.yahoo.vespa.model.application.validation.change.VespaConfigChangeAction; -import com.yahoo.vespa.model.application.validation.change.VespaRefeedAction; +import com.yahoo.vespa.model.application.validation.change.VespaRestartAction; import java.time.Instant; import java.util.ArrayList; @@ -65,11 +65,9 @@ public class StructFieldAttributeChangeValidator { return next.structFieldAttributes.stream() .filter(nextAttr -> current.hasFieldForStructFieldAttribute(nextAttr) && !current.hasStructFieldAttribute(nextAttr)) - .map(nextAttr -> VespaRefeedAction.of("field-type-change", - overrides, + .map(nextAttr -> new VespaRestartAction( new ChangeMessageBuilder(nextAttr.getName()) - .addChange("add attribute aspect").build(), - now)) + .addChange("add attribute aspect").build())) .collect(Collectors.toList()); } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidatorTest.java index 43db1c65d37..c24b5250a5d 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidatorTest.java @@ -43,8 +43,7 @@ public class DocumentDatabaseChangeValidatorTest { "field f4 type array<s> { struct-field s1 { indexing: attribute } }"); f.assertValidation(Arrays.asList( newRestartAction("Field 'f1' changed: add attribute aspect"), - newRefeedAction("field-type-change", - "Field 'f4.s1' changed: add attribute aspect"), + newRestartAction("Field 'f4.s1' changed: add attribute aspect"), newRefeedAction("indexing-change", ValidationOverrides.empty, "Field 'f2' changed: add index aspect, indexing script: '{ input f2 | summary f2; }' -> " + diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidatorTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidatorTestCase.java index c224e801fa3..2d68284c9a5 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidatorTestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidatorTestCase.java @@ -9,7 +9,7 @@ import java.time.Instant; import java.util.ArrayList; import java.util.List; -import static com.yahoo.vespa.model.application.validation.change.ConfigChangeTestUtils.newRefeedAction; +import static com.yahoo.vespa.model.application.validation.change.ConfigChangeTestUtils.newRestartAction; /** * @author geirst @@ -47,24 +47,24 @@ public class StructFieldAttributeChangeValidatorTestCase { } @Test - public void adding_attribute_aspect_to_struct_field_requires_refeed() throws Exception { + public void adding_attribute_aspect_to_struct_field_requires_restart() throws Exception { validate(arrayOfStruct(oneFieldStruct(), ""), arrayOfStruct(oneFieldStruct(), structAttribute("s1")), - newRefeedAction("field-type-change", "Field 'f1.s1' changed: add attribute aspect")); + newRestartAction("Field 'f1.s1' changed: add attribute aspect")); validate(mapOfStruct(oneFieldStruct(), ""), mapOfStruct(oneFieldStruct(), structAttribute("key")), - newRefeedAction("field-type-change", "Field 'f1.key' changed: add attribute aspect")); + newRestartAction("Field 'f1.key' changed: add attribute aspect")); validate(mapOfStruct(oneFieldStruct(), ""), mapOfStruct(oneFieldStruct(), structAttribute("value.s1")), - newRefeedAction("field-type-change", "Field 'f1.value.s1' changed: add attribute aspect")); + newRestartAction("Field 'f1.value.s1' changed: add attribute aspect")); validate(mapOfPrimitive(""), mapOfPrimitive(structAttribute("key")), - newRefeedAction("field-type-change", "Field 'f1.key' changed: add attribute aspect")); + newRestartAction("Field 'f1.key' changed: add attribute aspect")); validate(mapOfPrimitive(""), mapOfPrimitive(structAttribute("value")), - newRefeedAction("field-type-change", "Field 'f1.value' changed: add attribute aspect")); + newRestartAction("Field 'f1.value' changed: add attribute aspect")); } @Test |