summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-02-14 12:54:50 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-02-14 12:54:50 +0000
commited68af722775fbcecb2b116a16a8fe2154184787 (patch)
tree029167db4b30745464c8d58ac14a9ac1454b7f0b /config-model
parent1c7e183694e51b8e846e10f6446d09989ad96a1c (diff)
Allow count attribute on persistence-threads
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/resources/schema/content.rnc3
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java44
2 files changed, 42 insertions, 5 deletions
diff --git a/config-model/src/main/resources/schema/content.rnc b/config-model/src/main/resources/schema/content.rnc
index 8b3868c132e..bd09902f929 100644
--- a/config-model/src/main/resources/schema/content.rnc
+++ b/config-model/src/main/resources/schema/content.rnc
@@ -57,6 +57,9 @@ PersistenceThread = element thread {
## Declare which storage threads each disk should have.
PersistenceThreads = element persistence-threads {
+ ## The number of threads to create
+ attribute count { xsd:integer }? &
+ ## All of the below settings are deprecated.
## Operations with priority worse than this can be blocked
attribute highest-priority-to-block { xsd:string } ? &
## Operations with priority better than this can block others
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java
index 21c384dfc69..8f60ad6217f 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java
@@ -112,11 +112,7 @@ public class StorageClusterTest {
"<cluster id=\"bees\">\n" +
" <documents/>" +
" <tuning>\n" +
- " <persistence-threads>\n" +
- " <thread lowest-priority=\"VERY_LOW\" count=\"2\"/>\n" +
- " <thread lowest-priority=\"VERY_HIGH\" count=\"1\"/>\n" +
- " <thread count=\"1\"/>\n" +
- " </persistence-threads>\n" +
+ " <persistence-threads count=\"7\"/>\n" +
" </tuning>\n" +
" <group>" +
" <node distribution-key=\"0\" hostalias=\"mockhost\"/>" +
@@ -130,6 +126,44 @@ public class StorageClusterTest {
stc.getConfig(builder);
StorFilestorConfig config = new StorFilestorConfig(builder);
+ assertEquals(7, config.num_threads());
+ assertEquals(false, config.enable_multibit_split_optimalization());
+ }
+ {
+ assertEquals(1, stc.getChildren().size());
+ StorageNode sn = stc.getChildren().values().iterator().next();
+ StorFilestorConfig.Builder builder = new StorFilestorConfig.Builder();
+ sn.getConfig(builder);
+ StorFilestorConfig config = new StorFilestorConfig(builder);
+ assertEquals(7, config.num_threads());
+ }
+ }
+
+ @Test
+ public void testPersistenceThreadsOld() throws Exception {
+
+ StorageCluster stc = parse(
+ "<cluster id=\"bees\">\n" +
+ " <documents/>" +
+ " <tuning>\n" +
+ " <persistence-threads>\n" +
+ " <thread lowest-priority=\"VERY_LOW\" count=\"2\"/>\n" +
+ " <thread lowest-priority=\"VERY_HIGH\" count=\"1\"/>\n" +
+ " <thread count=\"1\"/>\n" +
+ " </persistence-threads>\n" +
+ " </tuning>\n" +
+ " <group>" +
+ " <node distribution-key=\"0\" hostalias=\"mockhost\"/>" +
+ " </group>" +
+ "</cluster>",
+ new Flavor(new FlavorsConfig.Flavor.Builder().name("test-flavor").minCpuCores(9).build())
+ );
+
+ {
+ StorFilestorConfig.Builder builder = new StorFilestorConfig.Builder();
+ stc.getConfig(builder);
+ StorFilestorConfig config = new StorFilestorConfig(builder);
+
assertEquals(4, config.num_threads());
assertEquals(false, config.enable_multibit_split_optimalization());
}