summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/schema/document
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-05-19 13:14:52 +0000
committerGeir Storli <geirst@yahooinc.com>2022-05-19 13:14:52 +0000
commit06f290f5477996d86cbc4a5d98da68e5cf0cb367 (patch)
tree92dc39f69290b50109676e2ae11f7c7636995fda /config-model/src/main/java/com/yahoo/schema/document
parent340f78ced167cc2bbf02c7541664b0c305b6a1e9 (diff)
Changing 'fast-rank' on an attribute should trigger the restart action.
Add more testing of 'fast-rank' on un-supported attributes.
Diffstat (limited to 'config-model/src/main/java/com/yahoo/schema/document')
-rw-r--r--config-model/src/main/java/com/yahoo/schema/document/Attribute.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/document/Attribute.java b/config-model/src/main/java/com/yahoo/schema/document/Attribute.java
index f2279a52855..5593c3f8cdf 100644
--- a/config-model/src/main/java/com/yahoo/schema/document/Attribute.java
+++ b/config-model/src/main/java/com/yahoo/schema/document/Attribute.java
@@ -232,7 +232,9 @@ public final class Attribute implements Cloneable, Serializable {
public void setEnableBitVectors(boolean enableBitVectors) { this.enableBitVectors = enableBitVectors; }
public void setEnableOnlyBitVector(boolean enableOnlyBitVector) { this.enableOnlyBitVector = enableOnlyBitVector; }
public void setFastRank(boolean value) {
- Supplier<IllegalArgumentException> badGen = () -> new IllegalArgumentException("fast-rank is only valid for tensor attributes, invalid for: "+this);
+ Supplier<IllegalArgumentException> badGen = () ->
+ new IllegalArgumentException("The " + toString() + " does not support 'fast-rank'. " +
+ "Only supported for tensor types with at least one mapped dimension");
var tt = tensorType.orElseThrow(badGen);
for (var dim : tt.dimensions()) {
if (dim.isMapped()) {
@@ -425,7 +427,7 @@ public final class Attribute implements Cloneable, Serializable {
@Override
public String toString() {
- return "attribute '" + name + "' (" + type + ")";
+ return "attribute '" + name + "' (" + (tensorType.isPresent() ? tensorType.get() : type) + ")";
}
public Set<String> getAliases() {