summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java45
1 files changed, 23 insertions, 22 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java
index 26bebad93b4..93cd64b76c9 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java
@@ -89,11 +89,34 @@ public class AttributeChangeValidator {
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;
}
+ private static void validateAttributeSetting(Attribute currentAttr, Attribute nextAttr,
+ Predicate<Attribute> predicate, String setting,
+ List<VespaConfigChangeAction> result) {
+ final boolean nextValue = predicate.test(nextAttr);
+ if (predicate.test(currentAttr) != nextValue) {
+ String change = nextValue ? "add" : "remove";
+ result.add(new VespaRestartAction(new ChangeMessageBuilder(nextAttr.getName()).
+ addChange(change + " attribute '" + setting + "'").build()));
+ }
+ }
+
+ private static <T> void validateAttributeSetting(Attribute currentAttr, Attribute nextAttr,
+ Function<Attribute, T> settingValueProvider, String setting,
+ List<VespaConfigChangeAction> result) {
+ T currentValue = settingValueProvider.apply(currentAttr);
+ T nextValue = settingValueProvider.apply(nextAttr);
+ if ( ! Objects.equals(currentValue, nextValue)) {
+ String message = String.format("change property '%s' from '%s' to '%s'", setting, currentValue, nextValue);
+ result.add(new VespaRestartAction(new ChangeMessageBuilder(nextAttr.getName()).addChange(message).build()));
+ }
+ }
+
private List<VespaConfigChangeAction> validateTensorTypes(final ValidationOverrides overrides, Instant now) {
final List<VespaConfigChangeAction> result = new ArrayList<>();
@@ -128,26 +151,4 @@ public class AttributeChangeValidator {
nextAttr.tensorType().get().toString()).build(), now);
}
- private static void validateAttributeSetting(Attribute currentAttr, Attribute nextAttr,
- Predicate<Attribute> predicate, String setting,
- List<VespaConfigChangeAction> result) {
- final boolean nextValue = predicate.test(nextAttr);
- if (predicate.test(currentAttr) != nextValue) {
- String change = nextValue ? "add" : "remove";
- result.add(new VespaRestartAction(new ChangeMessageBuilder(nextAttr.getName()).
- addChange(change + " attribute '" + setting + "'").build()));
- }
- }
-
- private static <T> void validateAttributeSetting(Attribute currentAttr, Attribute nextAttr,
- Function<Attribute, T> settingValueProvider, String setting,
- List<VespaConfigChangeAction> result) {
- T currentValue = settingValueProvider.apply(currentAttr);
- T nextValue = settingValueProvider.apply(nextAttr);
- if ( ! Objects.equals(currentValue, nextValue)) {
- String message = String.format("change property '%s' from '%s' to '%s'", setting, currentValue, nextValue);
- result.add(new VespaRestartAction(new ChangeMessageBuilder(nextAttr.getName()).addChange(message).build()));
- }
- }
-
}