summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2020-01-14 19:35:13 +0100
committerGitHub <noreply@github.com>2020-01-14 19:35:13 +0100
commitc41de101014bb48295fb0e91b51ffde85e028b21 (patch)
treec044fb62d7eed8fe46f92cda1e730728db1b4133
parent6d09bcb10d27f3980547cd5ea24cefdd6e115ee1 (diff)
parent00bb4c7d75edf8b04bad40962adb648b36418586 (diff)
Merge pull request #11781 from vespa-engine/bratseth/add-a-test
Unit test 1-d map short form modify update
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java1
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java7
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/AllocatedHosts.java2
-rw-r--r--document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java10
5 files changed, 14 insertions, 8 deletions
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java
index 603cfef5708..94058aff45c 100644
--- a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java
@@ -9,6 +9,7 @@ import java.util.Objects;
* @author bjorncs
*/
public class ClusterId {
+
public static final ClusterId CONFIG_SERVER = new ClusterId("zone-config-servers");
private final String id;
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java b/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java
index ad61e0f48a3..2cfd2e23d08 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java
@@ -84,7 +84,7 @@ import static com.yahoo.text.StringUtilities.quote;
* <p>
* The root ConfigProducer node for all Vespa systems (there is currently only one).
* The main class for building the Vespa model.
- * </p>
+ * <p>
* The vespa model starts in an unfrozen state, where children can be added freely,
* but no structure dependent information can be used.
* When frozen, structure dependent information(such as config id and controller) are
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java
index 797341afefa..887397c6edb 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java
@@ -44,9 +44,7 @@ public class NodesSpecification {
private final boolean exclusive;
- /**
- * Whether this requires running container and content processes co-located on the same node.
- */
+ /** Whether this requires running container and content processes co-located on the same node. */
private final boolean combined;
/** The resources each node should have, or empty to use the default */
@@ -175,9 +173,8 @@ public class NodesSpecification {
ClusterSpec.Type clusterType,
ClusterSpec.Id clusterId,
DeployLogger logger) {
- if (combined) {
+ if (combined)
clusterType = ClusterSpec.Type.combined;
- }
ClusterSpec cluster = ClusterSpec.request(clusterType, clusterId, version, exclusive);
return hostSystem.allocateHosts(cluster, Capacity.fromCount(count, resources, required, canFail), groups, logger);
}
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/AllocatedHosts.java b/config-provisioning/src/main/java/com/yahoo/config/provision/AllocatedHosts.java
index c6228dc71e9..8a0c97ec435 100644
--- a/config-provisioning/src/main/java/com/yahoo/config/provision/AllocatedHosts.java
+++ b/config-provisioning/src/main/java/com/yahoo/config/provision/AllocatedHosts.java
@@ -7,8 +7,6 @@ import java.util.Set;
/**
* The hosts allocated to an application.
- * This can be serialized to/from JSON.
- * This is immutable.
*
* @author Ulf Lilleengen
* @author bratseth
diff --git a/document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java b/document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java
index 54ae3d6d373..c191851acbe 100644
--- a/document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java
+++ b/document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java
@@ -1488,6 +1488,16 @@ public class JsonReaderTestCase {
}
@Test
+ public void tensor_modify_update_on_sparse_tensor_with_single_dimension_short_form() {
+ assertTensorModifyUpdate("{{x:a}:2.0, {x:c}: 3.0}", TensorModifyUpdate.Operation.REPLACE, "sparse_single_dimension_tensor",
+ inputJson("{",
+ " 'operation': 'replace',",
+ " 'cells': {",
+ " 'a': 2.0,",
+ " 'c': 3.0 }}"));
+ }
+
+ @Test
public void tensor_modify_update_with_replace_operation_mixed() {
assertTensorModifyUpdate("{{x:a,y:0}:2.0}", TensorModifyUpdate.Operation.REPLACE, "mixed_tensor",
inputJson("{",