diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-01-13 15:25:10 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-01-13 15:25:10 +0100 |
commit | d062b10856a61208627f039e7b37f4caeabd42bc (patch) | |
tree | d84d0b5141169baf0c7b6d313de6de51c2b4d8cf /config-model | |
parent | 904b825d0d473cd74b7cc863bc808fa62cfb58d0 (diff) |
Remove unused parameters
Diffstat (limited to 'config-model')
7 files changed, 23 insertions, 30 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/IndexedSearchClusterChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/IndexedSearchClusterChangeValidator.java index 58cea8c23e5..2fbf4359121 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/IndexedSearchClusterChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/IndexedSearchClusterChangeValidator.java @@ -32,23 +32,19 @@ public class IndexedSearchClusterChangeValidator implements ChangeValidator { for (Map.Entry<String, ContentCluster> currentEntry : current.getContentClusters().entrySet()) { ContentCluster nextCluster = next.getContentClusters().get(currentEntry.getKey()); if (nextCluster != null && nextCluster.getSearch().hasIndexedCluster()) { - result.addAll(validateContentCluster(currentEntry.getValue(), nextCluster, overrides, now)); + result.addAll(validateContentCluster(currentEntry.getValue(), nextCluster)); } } return result; } private static List<ConfigChangeAction> validateContentCluster(ContentCluster currentCluster, - ContentCluster nextCluster, - ValidationOverrides overrides, - Instant now) { - return validateDocumentDatabases(currentCluster, nextCluster, overrides, now); + ContentCluster nextCluster) { + return validateDocumentDatabases(currentCluster, nextCluster); } private static List<ConfigChangeAction> validateDocumentDatabases(ContentCluster currentCluster, - ContentCluster nextCluster, - ValidationOverrides overrides, - Instant now) { + ContentCluster nextCluster) { List<ConfigChangeAction> result = new ArrayList<>(); for (DocumentDatabase currentDb : getDocumentDbs(currentCluster.getSearch())) { String docTypeName = currentDb.getName(); @@ -56,7 +52,7 @@ public class IndexedSearchClusterChangeValidator implements ChangeValidator { filter(db -> db.getName().equals(docTypeName)).findFirst(); if (nextDb.isPresent()) { result.addAll(validateDocumentDatabase(currentCluster, nextCluster, docTypeName, - currentDb, nextDb.get(), overrides, now)); + currentDb, nextDb.get())); } } return result; @@ -66,13 +62,11 @@ public class IndexedSearchClusterChangeValidator implements ChangeValidator { ContentCluster nextCluster, String docTypeName, DocumentDatabase currentDb, - DocumentDatabase nextDb, - ValidationOverrides overrides, - Instant now) { + DocumentDatabase nextDb) { NewDocumentType currentDocType = currentCluster.getDocumentDefinitions().get(docTypeName); NewDocumentType nextDocType = nextCluster.getDocumentDefinitions().get(docTypeName); List<VespaConfigChangeAction> result = - new DocumentDatabaseChangeValidator(currentCluster.id(), currentDb, currentDocType, nextDb, nextDocType).validate(overrides, now); + new DocumentDatabaseChangeValidator(currentCluster.id(), currentDb, currentDocType, nextDb, nextDocType).validate(); return modifyActions(result, getSearchNodeServices(nextCluster.getSearch().getIndexed()), docTypeName); } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidator.java index ce435a4c157..5596169958a 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidator.java @@ -36,12 +36,12 @@ public class DocumentDatabaseChangeValidator { this.nextDocType = nextDocType; } - public List<VespaConfigChangeAction> validate(ValidationOverrides overrides, Instant now) { + public List<VespaConfigChangeAction> validate() { List<VespaConfigChangeAction> result = new ArrayList<>(); result.addAll(validateAttributeChanges()); - result.addAll(validateStructFieldAttributeChanges(overrides, now)); - result.addAll(validateIndexingScriptChanges(overrides, now)); - result.addAll(validateDocumentTypeChanges(overrides, now)); + result.addAll(validateStructFieldAttributeChanges()); + result.addAll(validateIndexingScriptChanges()); + result.addAll(validateDocumentTypeChanges()); return result; } @@ -54,23 +54,23 @@ public class DocumentDatabaseChangeValidator { .validate(); } - private List<VespaConfigChangeAction> validateStructFieldAttributeChanges(ValidationOverrides overrides, Instant now) { + private List<VespaConfigChangeAction> validateStructFieldAttributeChanges() { return new StructFieldAttributeChangeValidator(id, currentDocType, currentDatabase.getDerivedConfiguration().getAttributeFields(), nextDocType, nextDatabase.getDerivedConfiguration().getAttributeFields()) - .validate(overrides, now); + .validate(); } - private List<VespaConfigChangeAction> validateIndexingScriptChanges(ValidationOverrides overrides, Instant now) { + private List<VespaConfigChangeAction> validateIndexingScriptChanges() { return new IndexingScriptChangeValidator(id, currentDatabase.getDerivedConfiguration().getSearch(), nextDatabase.getDerivedConfiguration().getSearch()) - .validate(overrides, now); + .validate(); } - private List<VespaConfigChangeAction> validateDocumentTypeChanges(ValidationOverrides overrides, Instant now) { + private List<VespaConfigChangeAction> validateDocumentTypeChanges() { return new DocumentTypeChangeValidator(id, currentDocType, nextDocType) .validate(); } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidator.java index e3f3abf0747..2effc42cbef 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidator.java @@ -35,7 +35,7 @@ public class IndexingScriptChangeValidator { this.nextSearch = nextSearch; } - public List<VespaConfigChangeAction> validate(ValidationOverrides overrides, Instant now) { + public List<VespaConfigChangeAction> validate() { List<VespaConfigChangeAction> result = new ArrayList<>(); for (ImmutableSDField nextField : nextSearch.allConcreteFields()) { String fieldName = nextField.getName(); diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidator.java index e8b2d593de6..a86277dded8 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidator.java @@ -52,20 +52,19 @@ public class StructFieldAttributeChangeValidator { this.nextAttributes = nextAttributes; } - public List<VespaConfigChangeAction> validate(ValidationOverrides overrides, Instant now) { + public List<VespaConfigChangeAction> validate() { List<VespaConfigChangeAction> result = new ArrayList(); for (Field currentField : currentDocType.getAllFields()) { Field nextField = nextDocType.getField(currentField.getName()); if (nextField != null) { result.addAll(validateAddAttributeAspect(new Context(currentField, currentAttributes), - new Context(nextField, nextAttributes), - overrides, now)); + new Context(nextField, nextAttributes))); } } return result; } - private List<VespaConfigChangeAction> validateAddAttributeAspect(Context current, Context next, ValidationOverrides overrides, Instant now) { + private List<VespaConfigChangeAction> validateAddAttributeAspect(Context current, Context next) { return next.structFieldAttributes.stream() .filter(nextAttr -> current.hasFieldForStructFieldAttribute(nextAttr) && !current.hasStructFieldAttribute(nextAttr)) diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidatorTest.java index 1f64d41e371..27a32f3e754 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentDatabaseChangeValidatorTest.java @@ -31,7 +31,7 @@ public class DocumentDatabaseChangeValidatorTest { @Override public List<VespaConfigChangeAction> validate() { - return validator.validate(ValidationOverrides.empty, Instant.now()); + return validator.validate(); } } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidatorTest.java index 2e1ec53f886..20f5a9c841c 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/IndexingScriptChangeValidatorTest.java @@ -29,7 +29,7 @@ public class IndexingScriptChangeValidatorTest { @Override public List<VespaConfigChangeAction> validate() { - return validator.validate(ValidationOverrides.empty, Instant.now()); + return validator.validate(); } } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidatorTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidatorTestCase.java index 0bc4ecbfdfd..d37ab8be9a2 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidatorTestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/StructFieldAttributeChangeValidatorTestCase.java @@ -35,7 +35,7 @@ public class StructFieldAttributeChangeValidatorTestCase { @Override public List<VespaConfigChangeAction> validate() { List<VespaConfigChangeAction> result = new ArrayList<>(); - result.addAll(structFieldAttributeValidator.validate(ValidationOverrides.empty, Instant.now())); + result.addAll(structFieldAttributeValidator.validate()); result.addAll(docTypeValidator.validate()); return result; } |