aboutsummaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/test/MockApplicationPackage.java9
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/ConstantTensorTransformer.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java7
-rw-r--r--config-model/src/main/javacc/SDParser.jj2
-rw-r--r--config-model/src/test/derived/tensor/rank-profiles.cfg28
-rw-r--r--config-model/src/test/derived/tensor/tensor.sd18
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java2
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java8
8 files changed, 57 insertions, 19 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/test/MockApplicationPackage.java b/config-model/src/main/java/com/yahoo/config/model/test/MockApplicationPackage.java
index c30c62b44bc..f95f75c5af3 100644
--- a/config-model/src/main/java/com/yahoo/config/model/test/MockApplicationPackage.java
+++ b/config-model/src/main/java/com/yahoo/config/model/test/MockApplicationPackage.java
@@ -2,7 +2,6 @@
package com.yahoo.config.model.test;
import com.yahoo.config.application.api.ComponentInfo;
-import com.yahoo.config.application.api.DeployLogger;
import com.yahoo.config.application.api.UnparsedConfigDefinition;
import com.yahoo.config.application.api.ApplicationFile;
import com.yahoo.config.provision.Version;
@@ -242,12 +241,4 @@ public class MockApplicationPackage implements ApplicationPackage {
}
}
- @Override
- public void validateXML(DeployLogger logger) throws IOException {
- if (failOnValidateXml) {
- throw new IllegalArgumentException("Error in application package");
- } else {
- throw new UnsupportedOperationException("This application package cannot validate XML");
- }
- }
}
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/ConstantTensorTransformer.java b/config-model/src/main/java/com/yahoo/searchdefinition/ConstantTensorTransformer.java
index 01667841294..b10a8633a3a 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/ConstantTensorTransformer.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/ConstantTensorTransformer.java
@@ -65,7 +65,7 @@ class ConstantTensorTransformer extends ExpressionTransformer {
}
TensorValue tensorValue = (TensorValue)value;
String featureName = "constant(" + node.getName() + ")";
- String tensorType = (tensorValue.getType().isPresent() ? tensorValue.getType().get().toString() : "tensor");
+ String tensorType = tensorValue.asTensor().type().toString();
rankPropertiesOutput.put(featureName + ".value", tensorValue.toString());
rankPropertiesOutput.put(featureName + ".type", tensorType);
return new ReferenceNode("constant", Arrays.asList(new NameNode(node.getName())), null);
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java
index b1bb6f233b8..1783c89d784 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java
@@ -287,9 +287,6 @@ public class VespaMetricSet extends MetricSet {
//Distributor
- metrics.add(new Metric("vds.visitor.sum.latency.average"));
- metrics.add(new Metric("vds.visitor.sum.failed.rate"));
-
metrics.add(new Metric("vds.idealstate.buckets_rechecking.average"));
metrics.add(new Metric("vds.idealstate.idealstate_diff.average"));
metrics.add(new Metric("vds.idealstate.buckets_toofewcopies.average"));
@@ -324,6 +321,10 @@ public class VespaMetricSet extends MetricSet {
metrics.add(new Metric("vds.distributor.gets.sum.latency.average"));
metrics.add(new Metric("vds.distributor.gets.sum.ok.rate"));
metrics.add(new Metric("vds.distributor.gets.sum.failures.total.rate"));
+ metrics.add(new Metric("vds.distributor.visitor.sum.latency.average"));
+ metrics.add(new Metric("vds.distributor.visitor.sum.ok.rate"));
+ metrics.add(new Metric("vds.distributor.visitor.sum.failures.total.rate"));
+
metrics.add(new Metric("vds.distributor.docsstored.average"));
metrics.add(new Metric("vds.distributor.bytesstored.average"));
diff --git a/config-model/src/main/javacc/SDParser.jj b/config-model/src/main/javacc/SDParser.jj
index 57ff9854b1b..32be8906ffc 100644
--- a/config-model/src/main/javacc/SDParser.jj
+++ b/config-model/src/main/javacc/SDParser.jj
@@ -2321,7 +2321,7 @@ void constantTensor(RankProfile profile, String name) :
tensorType = tensorTypeWithPrefix(constantTensorErrorMessage(profile.getName(), name)) ) (<NL>)* )* <RBRACE>
{
if (tensorType != null) {
- profile.addConstantTensor(name, new TensorValue(Tensor.from(tensorString), tensorType));
+ profile.addConstantTensor(name, new TensorValue(Tensor.from(tensorType, tensorString)));
} else {
profile.addConstantTensor(name, new TensorValue(Tensor.from(tensorString)));
}
diff --git a/config-model/src/test/derived/tensor/rank-profiles.cfg b/config-model/src/test/derived/tensor/rank-profiles.cfg
new file mode 100644
index 00000000000..d70555c9131
--- /dev/null
+++ b/config-model/src/test/derived/tensor/rank-profiles.cfg
@@ -0,0 +1,28 @@
+rankprofile[].name "default"
+rankprofile[].fef.property[].name "vespa.type.attribute.f4"
+rankprofile[].fef.property[].value "tensor(x[10],y[20])"
+rankprofile[].name "unranked"
+rankprofile[].fef.property[].name "vespa.rank.firstphase"
+rankprofile[].fef.property[].value "value(0)"
+rankprofile[].fef.property[].name "vespa.hitcollector.heapsize"
+rankprofile[].fef.property[].value "0"
+rankprofile[].fef.property[].name "vespa.hitcollector.arraysize"
+rankprofile[].fef.property[].value "0"
+rankprofile[].fef.property[].name "vespa.dump.ignoredefaultfeatures"
+rankprofile[].fef.property[].value "true"
+rankprofile[].fef.property[].name "vespa.type.attribute.f4"
+rankprofile[].fef.property[].value "tensor(x[10],y[20])"
+rankprofile[].name "profile1"
+rankprofile[].fef.property[].name "vespa.rank.firstphase"
+rankprofile[].fef.property[].value "rankingExpression(firstphase)"
+rankprofile[].fef.property[].name "rankingExpression(firstphase).rankingScript"
+rankprofile[].fef.property[].value "map(attribute(f4), f(x)(x * x)) + reduce(tensor(x[2],y[3])(random), count) * rename(attribute(f4), (x, y), (y, x))"
+rankprofile[].fef.property[].name "vespa.type.attribute.f4"
+rankprofile[].fef.property[].value "tensor(x[10],y[20])"
+rankprofile[].name "profile2"
+rankprofile[].fef.property[].name "vespa.rank.firstphase"
+rankprofile[].fef.property[].value "rankingExpression(firstphase)"
+rankprofile[].fef.property[].name "rankingExpression(firstphase).rankingScript"
+rankprofile[].fef.property[].value "reduce(join(attribute(f4), tensor(x[2],y[2],z[3])((x==y)*(y==z)), f(a,b)(a * b)), sum, x)"
+rankprofile[].fef.property[].name "vespa.type.attribute.f4"
+rankprofile[].fef.property[].value "tensor(x[10],y[20])"
diff --git a/config-model/src/test/derived/tensor/tensor.sd b/config-model/src/test/derived/tensor/tensor.sd
index b89b96e253b..fab4cafddab 100644
--- a/config-model/src/test/derived/tensor/tensor.sd
+++ b/config-model/src/test/derived/tensor/tensor.sd
@@ -1,5 +1,6 @@
# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
search tensor {
+
document tensor {
field f1 type tensor {
indexing: summary
@@ -15,4 +16,21 @@ search tensor {
attribute: tensor(x[10],y[20])
}
}
+
+ rank-profile profile1 {
+
+ first-phase {
+ expression: map(attribute(f4),f(x)(x*x)) + reduce(random(x[2],y[3]), count) * rename(attribute(f4), (x, y), (y, x))
+ }
+
+ }
+
+ rank-profile profile2 {
+
+ first-phase {
+ expression: matmul(attribute(f4), diag(x[2],y[2],z[3]), x)
+ }
+
+ }
+
}
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java
index c93e07d57c1..635d9684dc9 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java
@@ -135,7 +135,7 @@ public class ExportingTestCase extends AbstractExportingTestCase {
}
@Test
- public void testTensorField() throws IOException, ParseException {
+ public void testTensor() throws IOException, ParseException {
assertCorrectDeriving("tensor");
}
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java
index 902608c34ba..595644b21ac 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java
@@ -109,7 +109,7 @@ public class RankingExpressionWithTensorTestCase {
" }");
f.assertSecondPhaseExpression("reduce(constant(my_tensor), sum)", "my_profile");
f.assertRankProperty("{{x:1}:1.0}", "constant(my_tensor).value", "my_profile");
- f.assertRankProperty("tensor", "constant(my_tensor).type", "my_profile");
+ f.assertRankProperty("tensor(x{})", "constant(my_tensor).type", "my_profile");
}
@Test
@@ -129,7 +129,7 @@ public class RankingExpressionWithTensorTestCase {
" }");
f.assertFirstPhaseExpression("reduce(constant(my_tensor), sum)", "my_profile");
f.assertRankProperty("{{x:1}:1.0}", "constant(my_tensor).value", "my_profile");
- f.assertRankProperty("tensor", "constant(my_tensor).type", "my_profile");
+ f.assertRankProperty("tensor(x{})", "constant(my_tensor).type", "my_profile");
}
@Test
@@ -151,7 +151,7 @@ public class RankingExpressionWithTensorTestCase {
f.assertFirstPhaseExpression("5.0 + my_macro", "my_profile");
f.assertMacro("reduce(constant(my_tensor), sum)", "my_macro", "my_profile");
f.assertRankProperty("{{x:1}:1.0}", "constant(my_tensor).value", "my_profile");
- f.assertRankProperty("tensor", "constant(my_tensor).type", "my_profile");
+ f.assertRankProperty("tensor(x{})", "constant(my_tensor).type", "my_profile");
}
@Test
@@ -171,7 +171,7 @@ public class RankingExpressionWithTensorTestCase {
" }");
f.assertFirstPhaseExpression("3.0 + reduce(constant(my_tensor), sum) + 5.0", "my_profile");
f.assertRankProperty("{{x:1}:1.0}", "constant(my_tensor).value", "my_profile");
- f.assertRankProperty("tensor", "constant(my_tensor).type", "my_profile");
+ f.assertRankProperty("tensor(x{})", "constant(my_tensor).type", "my_profile");
}
@Rule