summaryrefslogtreecommitdiffstats
path: root/config-model/src/test
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-01-25 14:28:47 +0100
committerTor Brede Vekterli <vekterli@yahooinc.com>2022-01-27 09:34:19 +0100
commita0d9f4d2066d08a3fe1dd826f19e39ab5cfd6055 (patch)
tree3d6b790d64375a418d64f95a7335ec69990a09a8 /config-model/src/test
parente7399b161668ffbe23aef55f2312710ac77e7a51 (diff)
Add feature flag for merge throttling policy
Two options; `STATIC` (default) and `DYNAMIC`. Does not currently set any window size configs based on the existing feature flag for max pending, so the config defaults will be used for these when dynamic throttling is enabled.
Diffstat (limited to 'config-model/src/test')
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/content/StorageClusterTest.java19
1 files changed, 19 insertions, 0 deletions
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 06b907ca2c2..2953b0cb32d 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
@@ -160,6 +160,25 @@ public class StorageClusterTest {
}
@Test
+ public void merge_throttling_policy_config_defaults_to_static() {
+ var config = configFromProperties(new TestProperties());
+ assertEquals(StorServerConfig.Merge_throttling_policy.Type.STATIC, config.merge_throttling_policy().type());
+ }
+
+ @Test
+ public void merge_throttling_policy_config_is_derived_from_flag() {
+ var config = configFromProperties(new TestProperties().setMergeThrottlingPolicy("STATIC"));
+ assertEquals(StorServerConfig.Merge_throttling_policy.Type.STATIC, config.merge_throttling_policy().type());
+
+ config = configFromProperties(new TestProperties().setMergeThrottlingPolicy("DYNAMIC"));
+ assertEquals(StorServerConfig.Merge_throttling_policy.Type.DYNAMIC, config.merge_throttling_policy().type());
+
+ // Invalid enum values fall back to the default
+ config = configFromProperties(new TestProperties().setMergeThrottlingPolicy("UKULELE"));
+ assertEquals(StorServerConfig.Merge_throttling_policy.Type.STATIC, config.merge_throttling_policy().type());
+ }
+
+ @Test
public void testVisitors() {
StorVisitorConfig.Builder builder = new StorVisitorConfig.Builder();
parse(cluster("bees",