summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2018-02-27 16:29:19 +0100
committerGeir Storli <geirst@oath.com>2018-02-27 16:29:19 +0100
commit52655b4add1d1771b3434e005628bdc0ef633bf6 (patch)
treea3d5a21b884641a024973fb063863a1348d49428 /config-model
parent86029a0a0eefacc98b5c86cd8921eed98f4882e6 (diff)
Add switch to enable multiple bucket spaces in cluster controller.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java1
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/ContentSearchClusterTest.java26
2 files changed, 22 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java
index 0b54b464da0..35975c5fcdc 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java
@@ -602,6 +602,7 @@ public class ContentCluster extends AbstractConfigProducer implements StorDistri
builder.min_distributor_up_ratio(0);
builder.min_storage_up_ratio(0);
}
+ builder.enable_multiple_bucket_spaces(enableMultipleBucketSpaces);
}
@Override
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentSearchClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentSearchClusterTest.java
index 67b084e4ce6..870d37bf4e2 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentSearchClusterTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentSearchClusterTest.java
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.content;
+import com.yahoo.vespa.config.content.FleetcontrollerConfig;
import com.yahoo.vespa.config.content.core.BucketspacesConfig;
import com.yahoo.vespa.config.search.core.ProtonConfig;
import com.yahoo.vespa.model.content.cluster.ContentCluster;
@@ -138,6 +139,15 @@ public class ContentSearchClusterTest {
return new BucketspacesConfig(builder);
}
+ private static FleetcontrollerConfig getFleetcontrollerConfig(ContentCluster cluster) {
+ FleetcontrollerConfig.Builder builder = new FleetcontrollerConfig.Builder();
+ cluster.getConfig(builder);
+ builder.cluster_name("unknown");
+ builder.index(0);
+ builder.zookeeper_server("unknown");
+ return new FleetcontrollerConfig(builder);
+ }
+
private static void assertDocumentType(String expName, String expBucketSpace, BucketspacesConfig.Documenttype docType) {
assertEquals(expName, docType.name());
assertEquals(expBucketSpace, docType.bucketspace());
@@ -155,11 +165,17 @@ public class ContentSearchClusterTest {
@Test
public void require_that_multiple_bucket_spaces_can_be_enabled() throws Exception {
- BucketspacesConfig config = getBucketspacesConfig(createClusterWithMultipleBucketSpacesEnabled());
- assertEquals(2, config.documenttype().size());
- assertDocumentType("global", "global", config.documenttype(0));
- assertDocumentType("regular", "default", config.documenttype(1));
- assertTrue(config.enable_multiple_bucket_spaces());
+ ContentCluster cluster = createClusterWithMultipleBucketSpacesEnabled();
+ {
+ BucketspacesConfig config = getBucketspacesConfig(cluster);
+ assertEquals(2, config.documenttype().size());
+ assertDocumentType("global", "global", config.documenttype(0));
+ assertDocumentType("regular", "default", config.documenttype(1));
+ assertTrue(config.enable_multiple_bucket_spaces());
+ }
+ {
+ assertTrue(getFleetcontrollerConfig(cluster).enable_multiple_bucket_spaces());
+ }
}
}