aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@oath.com>2018-05-09 14:55:24 +0200
committerTor Brede Vekterli <vekterli@oath.com>2018-05-31 10:55:38 +0200
commit033ee97414c5c9a32234537ebedb58f1e860ed13 (patch)
tree20999bf099f965c3a35f6878fec5435ffc1530cf /config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java
parentedc2ad6efe8fb8072e8860dc9a4849cfeb3d0680 (diff)
Implicitly enable multiple bucket spaces in config model
Removes validation of redundancy and searchable-copies for global documents, as these will now be globally distributed by default. Experimental override is still present to allow for forced enabling in upgrade scenarios.
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java36
1 files changed, 1 insertions, 35 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java
index 4bdef0607a2..0661ef67131 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/content/GlobalDistributionValidator.java
@@ -21,45 +21,11 @@ import static java.util.stream.Collectors.toSet;
public class GlobalDistributionValidator {
public void validate(Map<String, NewDocumentType> documentDefinitions,
- Set<NewDocumentType> globallyDistributedDocuments,
- Redundancy redundancy,
- boolean enableMultipleBucketSpaces) {
- if (!enableMultipleBucketSpaces) {
- verifyGlobalDocumentsHaveRequiredRedundancy(globallyDistributedDocuments, redundancy);
- verifySearchableCopiesIsSameAsRedundancy(globallyDistributedDocuments, redundancy);
- }
+ Set<NewDocumentType> globallyDistributedDocuments) {
verifyReferredDocumentsArePresent(documentDefinitions);
verifyReferredDocumentsAreGlobal(documentDefinitions, globallyDistributedDocuments);
}
- private static void verifyGlobalDocumentsHaveRequiredRedundancy(Set<NewDocumentType> globallyDistributedDocuments,
- Redundancy redundancy) {
- if (!globallyDistributedDocuments.isEmpty() && !redundancy.isEffectivelyGloballyDistributed()) {
- throw new IllegalArgumentException(
- String.format(
- "The following document types are marked as global, " +
- "but do not have high enough redundancy to make the documents globally distributed: %s. " +
- "Redundancy is %d, expected %d.",
- asPrintableString(toDocumentNameStream(globallyDistributedDocuments)),
- redundancy.effectiveFinalRedundancy(),
- redundancy.totalNodes()));
- }
- }
-
- private static void verifySearchableCopiesIsSameAsRedundancy(Set<NewDocumentType> globallyDistributedDocuments,
- Redundancy redundancy) {
- if (!globallyDistributedDocuments.isEmpty() &&
- redundancy.effectiveReadyCopies() != redundancy.effectiveFinalRedundancy()) {
- throw new IllegalArgumentException(
- String.format(
- "The following document types have the number of searchable copies less than redundancy: %s. " +
- "Searchable copies is %d, while redundancy is %d.",
- asPrintableString(toDocumentNameStream(globallyDistributedDocuments)),
- redundancy.effectiveReadyCopies(),
- redundancy.effectiveFinalRedundancy()));
- }
- }
-
private static void verifyReferredDocumentsArePresent(Map<String, NewDocumentType> documentDefinitions) {
Set<NewDocumentType.Name> unknowDocuments = getReferencedDocuments(documentDefinitions)
.filter(name -> !documentDefinitions.containsKey(name.toString()))