diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-08-12 09:06:57 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-08-12 09:06:57 +0200 |
commit | 43597d9f7e1c65563d5fddcb13f66000ad98b9e6 (patch) | |
tree | 32c93f0d311839755f5549e8665a97030874e3f1 /config-model/src/main/java/com | |
parent | 96d88f5e9273060bb8d264e2988cb854048cf1d6 (diff) |
Control swappable
Diffstat (limited to 'config-model/src/main/java/com')
4 files changed, 20 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/derived/AttributeFields.java b/config-model/src/main/java/com/yahoo/searchdefinition/derived/AttributeFields.java index 125b0cf2763..f9520159383 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/derived/AttributeFields.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/derived/AttributeFields.java @@ -222,6 +222,9 @@ public class AttributeFields extends Derived implements AttributesConfig.Produce if (attribute.isHuge()) { aaB.huge(true); } + if (attribute.isSwappable()) { + aaB.swappable(true); + } if (attribute.getSorting().isDescending()) { aaB.sortascending(false); } diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/document/Attribute.java b/config-model/src/main/java/com/yahoo/searchdefinition/document/Attribute.java index 0cf7a031dbc..0dacb832ab7 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/document/Attribute.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/document/Attribute.java @@ -57,6 +57,7 @@ public final class Attribute implements Cloneable, Serializable { private boolean fastAccess = false; private boolean huge = false; private boolean mutable = false; + private boolean swappable = false; private int arity = BooleanIndexDefinition.DEFAULT_ARITY; private long lowerBound = BooleanIndexDefinition.DEFAULT_LOWER_BOUND; private long upperBound = BooleanIndexDefinition.DEFAULT_UPPER_BOUND; @@ -194,6 +195,7 @@ public final class Attribute implements Cloneable, Serializable { public boolean isFastSearch() { return fastSearch; } public boolean isFastAccess() { return fastAccess; } public boolean isHuge() { return huge; } + public boolean isSwappable() { return swappable; } public boolean isPosition() { return isPosition; } public boolean isMutable() { return mutable; } @@ -226,6 +228,7 @@ public final class Attribute implements Cloneable, Serializable { public void setEnableOnlyBitVector(boolean enableOnlyBitVector) { this.enableOnlyBitVector = enableOnlyBitVector; } public void setFastSearch(boolean fastSearch) { this.fastSearch = fastSearch; } public void setHuge(boolean huge) { this.huge = huge; } + public void setSwappable(boolean swappable) { this.swappable = swappable; } public void setFastAccess(boolean fastAccess) { this.fastAccess = fastAccess; } public void setPosition(boolean position) { this.isPosition = position; } public void setMutable(boolean mutable) { this.mutable = mutable; } @@ -355,8 +358,9 @@ public final class Attribute implements Cloneable, Serializable { @Override public int hashCode() { return Objects.hash( - name, type, collectionType, sorting, dictionary, isPrefetch(), fastAccess, removeIfZero, createIfNonExistent, - isPosition, huge, enableBitVectors, enableOnlyBitVector, tensorType, referenceDocumentType, distanceMetric, hnswIndexParams); + name, type, collectionType, sorting, dictionary, isPrefetch(), fastAccess, removeIfZero, + createIfNonExistent, isPosition, huge, mutable, swappable, enableBitVectors, enableOnlyBitVector, + tensorType, referenceDocumentType, distanceMetric, hnswIndexParams); } @Override @@ -379,6 +383,8 @@ public final class Attribute implements Cloneable, Serializable { if (this.enableOnlyBitVector != other.enableOnlyBitVector) return false; if (this.fastSearch != other.fastSearch) return false; if (this.huge != other.huge) return false; + if (this.mutable != other.mutable) return false; + if (this.swappable != other.swappable) return false; if (! this.sorting.equals(other.sorting)) return false; if (! Objects.equals(dictionary, other.dictionary)) return false; if (! Objects.equals(tensorType, other.tensorType)) return false; diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/AttributeOperation.java b/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/AttributeOperation.java index 56e241adb8e..8c6c9ecd696 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/AttributeOperation.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/AttributeOperation.java @@ -18,9 +18,10 @@ public class AttributeOperation implements FieldOperation, FieldOperationContain private Boolean fastSearch; private Boolean fastAccess; private Boolean mutable; + private Boolean swappable; private Boolean enableBitVectors; private Boolean enableOnlyBitVector; - //TODO: Husk sorting!! + //TODO: Remember sorting!! private boolean doAlias = false; private String alias; private String aliasedName; @@ -73,6 +74,9 @@ public class AttributeOperation implements FieldOperation, FieldOperationContain public void setMutable(Boolean mutable) { this.mutable = mutable; } + public void setSwappable(Boolean swappable) { + this.swappable = swappable; + } public Boolean getEnableBitVectors() { return enableBitVectors; @@ -131,6 +135,9 @@ public class AttributeOperation implements FieldOperation, FieldOperationContain if (huge != null) { attribute.setHuge(huge); } + if (swappable != null) { + attribute.setSwappable(swappable); + } if (fastSearch != null) { attribute.setFastSearch(fastSearch); } 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 7a17fe5e80a..a5f4683c09b 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 @@ -105,6 +105,7 @@ public class AttributeChangeValidator { validateAttributeSetting(id, currAttr, nextAttr, AttributeChangeValidator::extractDictionaryType, "dictionary: btree/hash", result); validateAttributeSetting(id, currAttr, nextAttr, AttributeChangeValidator::extractDictionaryCase, "dictionary: cased/uncased", result); validateAttributeSetting(id, currAttr, nextAttr, Attribute::isHuge, "huge", result); + validateAttributeSetting(id, currAttr, nextAttr, Attribute::isSwappable, "swappable", result); validateAttributeSetting(id, currAttr, nextAttr, Attribute::densePostingListThreshold, "dense-posting-list-threshold", result); validateAttributeSetting(id, currAttr, nextAttr, Attribute::isEnabledOnlyBitVector, "rank: filter", result); validateAttributeSetting(id, currAttr, nextAttr, Attribute::distanceMetric, "distance-metric", result); |