summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java')
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java44
1 files changed, 24 insertions, 20 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java
index d98d1da9d2a..d6579ba88d4 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/content/ContentClusterTest.java
@@ -18,7 +18,7 @@ import com.yahoo.vespa.config.content.StorDistributionConfig;
import com.yahoo.vespa.config.content.StorFilestorConfig;
import com.yahoo.vespa.config.content.core.StorDistributormanagerConfig;
import com.yahoo.vespa.config.content.core.StorServerConfig;
-import com.yahoo.vespa.config.search.core.PartitionsConfig;
+import com.yahoo.vespa.config.search.DispatchConfig;
import com.yahoo.vespa.config.search.core.ProtonConfig;
import com.yahoo.vespa.model.VespaModel;
import com.yahoo.vespa.model.container.ContainerCluster;
@@ -271,25 +271,6 @@ public class ContentClusterTest extends ContentBaseTest {
assertEquals(1, cluster.getContainers().size());
}
- private void verifyRoundRobinPropertiesControl(boolean useAdaptiveDispatch) {
- VespaModel model = createEnd2EndOneNode(new TestProperties().setUseAdaptiveDispatch(useAdaptiveDispatch));
-
- ContentCluster cc = model.getContentClusters().get("storage");
- PartitionsConfig.Builder partBuilder = new PartitionsConfig.Builder();
- assertNotNull(cc.getSearch());
- assertNotNull(cc.getSearch().getIndexed());
- assertEquals(1, cc.getSearch().getIndexed().getTLDs().size());
- cc.getSearch().getIndexed().getTLDs().get(0).getConfig(partBuilder);
- PartitionsConfig partitionsConfig = new PartitionsConfig(partBuilder);
- assertFalse(useAdaptiveDispatch == partitionsConfig.dataset(0).useroundrobinforfixedrow());
- }
-
- @Test
- public void default_dispatch_controlled_by_properties() {
- verifyRoundRobinPropertiesControl(false);
- verifyRoundRobinPropertiesControl(true);
- }
-
@Test
public void testSearchTuning() {
String xml =
@@ -950,4 +931,27 @@ public class ContentClusterTest extends ContentBaseTest {
assertEquals(distributionBits, storDistributormanagerConfig.minsplitcount());
}
+ private void verifyRoundRobinPropertiesControl(boolean useAdaptiveDispatch) {
+ VespaModel model = createEnd2EndOneNode(new TestProperties().setUseAdaptiveDispatch(useAdaptiveDispatch));
+
+ ContentCluster cc = model.getContentClusters().get("storage");
+ DispatchConfig.Builder builder = new DispatchConfig.Builder();
+ cc.getSearch().getConfig(builder);
+
+ DispatchConfig cfg = new DispatchConfig(builder);
+ if (useAdaptiveDispatch) {
+ assertEquals(DispatchConfig.DistributionPolicy.ADAPTIVE, cfg.distributionPolicy());
+ } else {
+ assertEquals(DispatchConfig.DistributionPolicy.ROUNDROBIN, cfg.distributionPolicy());
+ }
+
+ }
+
+ @Test
+ public void default_dispatch_controlled_by_properties() {
+ verifyRoundRobinPropertiesControl(false);
+ verifyRoundRobinPropertiesControl(true);
+ }
+
+
}