summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHarald Musum <musum@yahoo-inc.com>2017-06-14 11:56:23 +0200
committerHarald Musum <musum@yahoo-inc.com>2017-06-14 11:56:23 +0200
commitcc2b688e861d4861e112e5135aac98b9a21f9ac7 (patch)
tree20028bd894cf0f5cf45fa0ed24ffefbbb0721649 /config-model
parent4410726baea2f8a0cfae923766aa3764265f0c38 (diff)
Use zone
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java15
1 files changed, 11 insertions, 4 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 8227be3347a..1ddfbbd76e1 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
@@ -594,15 +594,22 @@ public class ContentCluster extends AbstractConfigProducer implements StorDistri
*/
public int distributionBits() {
// TODO: Enable for all hosted zones (i.e when zone isn't default)
- List<RegionName> prodRegionsWith16DistributionBits =
- Stream.of("us-west-1", "us-central-1", "eu-west-1", "ap-northeast-1", "ap-northeast-2", "us-east-3")
- .map(RegionName::from).collect(Collectors.toList());
- if (zone.environment().equals(Environment.prod) && prodRegionsWith16DistributionBits.contains(zone.region()))
+ List<Zone> zonesWith16DistributionBits = Arrays.asList(createZone(Environment.prod, "us-west-1"),
+ createZone(Environment.prod, "us-central-1"),
+ createZone(Environment.prod, "eu-west-1"),
+ createZone(Environment.prod, "ap-northeast-1"),
+ createZone(Environment.prod, "ap-northeast-2"),
+ createZone(Environment.prod, "us-east-3"));
+ if (zonesWith16DistributionBits.contains(zone))
return 16;
else
return DistributionBitCalculator.getDistributionBits(getNodeCountPerGroup(), getDistributionMode());
}
+ private Zone createZone(Environment environment, String region) {
+ return new Zone(environment, RegionName.from(region));
+ }
+
@Override
public void validate() throws Exception {
super.validate();