diff options
author | Tor Egge <Tor.Egge@online.no> | 2023-10-31 14:24:07 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2023-10-31 14:24:07 +0100 |
commit | b9fe05eac1b6b655b28eb8ecaf18f250c1353a4e (patch) | |
tree | 1c82f762be1a38521b446632678bb13a674d57f8 /config-model | |
parent | c91d0b4f188c48f317f2029e3ec0abc05180d2f1 (diff) |
Use "document-summary" instead of "summary class" or "document summary".
Diffstat (limited to 'config-model')
13 files changed, 25 insertions, 25 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/parser/ConvertParsedSchemas.java b/config-model/src/main/java/com/yahoo/schema/parser/ConvertParsedSchemas.java index 7e19cb4a0ae..4fd4ab7c69b 100644 --- a/config-model/src/main/java/com/yahoo/schema/parser/ConvertParsedSchemas.java +++ b/config-model/src/main/java/com/yahoo/schema/parser/ConvertParsedSchemas.java @@ -188,7 +188,7 @@ public class ConvertParsedSchemas { while (true) { if (seen.contains(parsedField.name())) { throw new IllegalArgumentException("For schema '" + schema.getName() + - "' summary class '" + docsum.name() + + "' document-summary '" + docsum.name() + "' summary field '" + origName + "': Source loop detected for summary field '" + parsedField.name() + "'"); } @@ -210,7 +210,7 @@ public class ConvertParsedSchemas { return null; // Imported field, cannot resolve now } else if (source.equals(parsedField.name()) || !summaryFields.containsKey(source)) { throw new IllegalArgumentException("For schema '" + schema.getName() + - "', summary class '" + docsum.name() + + "', document-summary '" + docsum.name() + "', summary field '" + parsedField.name() + "': there is no valid source '" + source + "'."); } diff --git a/config-model/src/main/java/com/yahoo/schema/processing/ImplicitSummaries.java b/config-model/src/main/java/com/yahoo/schema/processing/ImplicitSummaries.java index 82bf95eb5eb..a05450aa3a0 100644 --- a/config-model/src/main/java/com/yahoo/schema/processing/ImplicitSummaries.java +++ b/config-model/src/main/java/com/yahoo/schema/processing/ImplicitSummaries.java @@ -185,7 +185,7 @@ public class ImplicitSummaries extends Processor { Attribute attribute = sourceField.getAttributes().get(sourceField.getName()); if (attribute != null) { String destinations = "document summary 'default'"; - if (summaryField.getDestinations().size() >0) { + if (summaryField.getDestinations().size() > 0) { destinations = "document summaries " + summaryField.getDestinations(); } deployLogger.logApplicationPackage(Level.WARNING, diff --git a/config-model/src/main/java/com/yahoo/schema/processing/MatchedElementsOnlyResolver.java b/config-model/src/main/java/com/yahoo/schema/processing/MatchedElementsOnlyResolver.java index d2ef467438f..e98afda34a8 100644 --- a/config-model/src/main/java/com/yahoo/schema/processing/MatchedElementsOnlyResolver.java +++ b/config-model/src/main/java/com/yahoo/schema/processing/MatchedElementsOnlyResolver.java @@ -88,7 +88,7 @@ public class MatchedElementsOnlyResolver extends Processor { } private String formatError(Schema schema, DocumentSummary summary, SummaryField field, String msg) { - return "For " + schema + ", document summary '" + summary.getName() + return "For " + schema + ", document-summary '" + summary.getName() + "', summary field '" + field.getName() + "': " + msg; } diff --git a/config-model/src/main/java/com/yahoo/schema/processing/SummaryDiskAccessValidator.java b/config-model/src/main/java/com/yahoo/schema/processing/SummaryDiskAccessValidator.java index 70e2bd038b8..38163058a10 100644 --- a/config-model/src/main/java/com/yahoo/schema/processing/SummaryDiskAccessValidator.java +++ b/config-model/src/main/java/com/yahoo/schema/processing/SummaryDiskAccessValidator.java @@ -56,7 +56,7 @@ public class SummaryDiskAccessValidator extends Processor { ": Fields " + implicitDiskFields + " references " + "non-attribute fields: Using this " + "summary will cause disk accesses. " + - "Set 'from-disk' on this summary class to silence this warning."); + "Set 'from-disk' on this document-summary to silence this warning."); } } diff --git a/config-model/src/main/java/com/yahoo/schema/processing/SummaryFieldsMustHaveValidSource.java b/config-model/src/main/java/com/yahoo/schema/processing/SummaryFieldsMustHaveValidSource.java index ac9dbf73e4f..421d6a74dc8 100644 --- a/config-model/src/main/java/com/yahoo/schema/processing/SummaryFieldsMustHaveValidSource.java +++ b/config-model/src/main/java/com/yahoo/schema/processing/SummaryFieldsMustHaveValidSource.java @@ -56,7 +56,7 @@ public class SummaryFieldsMustHaveValidSource extends Processor { private void verifySource(String source, SummaryField summaryField, DocumentSummary summary) { if ( ! isValid(source, summaryField, summary) ) { - throw new IllegalArgumentException("For " + schema + ", summary class '" + + throw new IllegalArgumentException("For " + schema + ", document-summary '" + summary.getName() + "'," + " summary field '" + summaryField.getName() + "': there is no valid source '" + source + "'."); } diff --git a/config-model/src/main/java/com/yahoo/schema/processing/SummaryNamesFieldCollisions.java b/config-model/src/main/java/com/yahoo/schema/processing/SummaryNamesFieldCollisions.java index d98f7e84b26..720cc3e5b56 100644 --- a/config-model/src/main/java/com/yahoo/schema/processing/SummaryNamesFieldCollisions.java +++ b/config-model/src/main/java/com/yahoo/schema/processing/SummaryNamesFieldCollisions.java @@ -41,10 +41,10 @@ public class SummaryNamesFieldCollisions extends Processor { if ( ! prevClass.equals(summary.getName())) { if ( ! prevSource.equals(source.getName())) { throw new IllegalArgumentException("For " + schema + - ", summary class '" + summary.getName() + "'," + + ", document-summary '" + summary.getName() + "'," + " summary field '" + summaryField.getName() + "':" + " Can not use source '" + source.getName() + - "' for this summary field, an equally named field in summary class '" + + "' for this summary field, an equally named field in document-summary '" + prevClass + "' uses a different source: '" + prevSource + "'."); } } diff --git a/config-model/src/main/java/com/yahoo/vespa/documentmodel/DocumentSummary.java b/config-model/src/main/java/com/yahoo/vespa/documentmodel/DocumentSummary.java index 6cd2d7721d5..32807db8405 100644 --- a/config-model/src/main/java/com/yahoo/vespa/documentmodel/DocumentSummary.java +++ b/config-model/src/main/java/com/yahoo/vespa/documentmodel/DocumentSummary.java @@ -120,7 +120,7 @@ public class DocumentSummary extends FieldView { @Override public String toString() { - return "document summary '" + getName() + "'"; + return "document-summary '" + getName() + "'"; } public void validate(DeployLogger logger) { diff --git a/config-model/src/main/java/com/yahoo/vespa/documentmodel/SummaryField.java b/config-model/src/main/java/com/yahoo/vespa/documentmodel/SummaryField.java index 1c53ee36497..d50d5e36134 100644 --- a/config-model/src/main/java/com/yahoo/vespa/documentmodel/SummaryField.java +++ b/config-model/src/main/java/com/yahoo/vespa/documentmodel/SummaryField.java @@ -240,7 +240,7 @@ public class SummaryField extends Field implements Cloneable, TypedKey { } private String getDestinationString() { - return destinations.stream().map(destination -> "document summary '" + destination + "'").collect(Collectors.joining(", ")); + return destinations.stream().map(destination -> "document-summary '" + destination + "'").collect(Collectors.joining(", ")); } @Override diff --git a/config-model/src/test/java/com/yahoo/schema/IncorrectSummaryTypesTestCase.java b/config-model/src/test/java/com/yahoo/schema/IncorrectSummaryTypesTestCase.java index dec7b90abf0..fc649691248 100644 --- a/config-model/src/test/java/com/yahoo/schema/IncorrectSummaryTypesTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/IncorrectSummaryTypesTestCase.java @@ -30,7 +30,7 @@ public class IncorrectSummaryTypesTestCase extends AbstractSchemaTestCase { "}\n"); fail("processing should have failed"); } catch (RuntimeException e) { - assertEquals("summary somestring type string in document summary 'default' is inconsistent with summary somestring type int in document summary 'incorrect': All declarations of the same summary field must have the same type", e.getMessage()); + assertEquals("summary somestring type string in document-summary 'default' is inconsistent with summary somestring type int in document-summary 'incorrect': All declarations of the same summary field must have the same type", e.getMessage()); } } diff --git a/config-model/src/test/java/com/yahoo/schema/SummaryTestCase.java b/config-model/src/test/java/com/yahoo/schema/SummaryTestCase.java index e1dcfe70e91..4f008e661c8 100644 --- a/config-model/src/test/java/com/yahoo/schema/SummaryTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/SummaryTestCase.java @@ -65,10 +65,10 @@ public class SummaryTestCase { ApplicationBuilder.createFromString(sd, logger); assertEquals(1, logger.entries.size()); assertEquals(Level.WARNING, logger.entries.get(0).level); - assertEquals("In schema 'disksummary', document summary 'foobar': " + + assertEquals("In schema 'disksummary', document-summary 'foobar': " + "Fields [foo2] references non-attribute fields: " + "Using this summary will cause disk accesses. " + - "Set 'from-disk' on this summary class to silence this warning.", + "Set 'from-disk' on this document-summary to silence this warning.", logger.entries.get(0).message); } @@ -217,8 +217,8 @@ public class SummaryTestCase { ApplicationBuilder.createFromString(sd, logger); fail("Expected exception"); } catch (IllegalArgumentException e) { - assertEquals("For schema 'music', summary class 'title2', summary field 'title': Can not use " + - "source 'title_short' for this summary field, an equally named field in summary class 'title' " + + assertEquals("For schema 'music', document-summary 'title2', summary field 'title': Can not use " + + "source 'title_short' for this summary field, an equally named field in document-summary 'title' " + "uses a different source: 'title'.", e.getMessage()); } } @@ -235,13 +235,13 @@ public class SummaryTestCase { "}"); DeployLoggerStub logger = new DeployLoggerStub(); ApplicationBuilder.createFromStrings(logger, schema); - assertEquals("document summary 'test_summary' inherits 'nonesuch' but this is not present in schema 'test'", + assertEquals("document-summary 'test_summary' inherits 'nonesuch' but this is not present in schema 'test'", logger.entries.get(0).message); // fail("Expected failure"); } catch (IllegalArgumentException e) { fail(); - // assertEquals("document summary 'test_summary' inherits nonesuch but this is not present in schema 'test'", + // assertEquals("document-summary 'test_summary' inherits nonesuch but this is not present in schema 'test'", // e.getMessage()); } } @@ -278,8 +278,8 @@ public class SummaryTestCase { fail("Expected failure"); } catch (IllegalArgumentException e) { - assertEquals("summary field1 type string in document summary 'default' is inconsistent with " + - "summary field1 type int in document summary 'parent2': " + + assertEquals("summary field1 type string in document-summary 'default' is inconsistent with " + + "summary field1 type int in document-summary 'parent2': " + "All declarations of the same summary field must have the same type", Exceptions.toMessageString(e)); } @@ -429,7 +429,7 @@ public class SummaryTestCase { ApplicationBuilder.createFromStrings(logger, sd); fail("expected exception"); } catch (IllegalArgumentException e) { - assertEquals("For schema 'test' summary class 'bar' summary field 'foo'" + + assertEquals("For schema 'test' document-summary 'bar' summary field 'foo'" + ": Source loop detected for summary field 'foo2'", e.getMessage()); } } diff --git a/config-model/src/test/java/com/yahoo/schema/processing/MatchedElementsOnlyResolverTestCase.java b/config-model/src/test/java/com/yahoo/schema/processing/MatchedElementsOnlyResolverTestCase.java index 91cd2418eef..d15f24fd99b 100644 --- a/config-model/src/test/java/com/yahoo/schema/processing/MatchedElementsOnlyResolverTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/processing/MatchedElementsOnlyResolverTestCase.java @@ -148,7 +148,7 @@ public class MatchedElementsOnlyResolverTestCase { " summary: matched-elements-only", "}")); }); - assertTrue(exception.getMessage().contains("For schema 'test', document summary 'default', summary field 'my_field': " + + assertTrue(exception.getMessage().contains("For schema 'test', document-summary 'default', summary field 'my_field': " + "'matched-elements-only' is not supported for this field type. " + "Supported field types are: array of primitive, weighted set of primitive, " + "array of simple struct, map of primitive type to simple struct, " + diff --git a/config-model/src/test/java/com/yahoo/schema/processing/SummaryDiskAccessValidatorTestCase.java b/config-model/src/test/java/com/yahoo/schema/processing/SummaryDiskAccessValidatorTestCase.java index bac29b52949..e49a715305e 100644 --- a/config-model/src/test/java/com/yahoo/schema/processing/SummaryDiskAccessValidatorTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/processing/SummaryDiskAccessValidatorTestCase.java @@ -33,7 +33,7 @@ public class SummaryDiskAccessValidatorTestCase { ApplicationBuilder.createFromString(sd, logger); assertEquals(1, logger.warnings.size()); assertThat(logger.warnings.get(0), - containsString("In schema 'test', document summary 'my_sum': " + + containsString("In schema 'test', document-summary 'my_sum': " + "Fields [str_map] references non-attribute fields: Using this summary will cause disk accesses")); } diff --git a/config-model/src/test/java/com/yahoo/schema/processing/SummaryFieldsMustHaveValidSourceTestCase.java b/config-model/src/test/java/com/yahoo/schema/processing/SummaryFieldsMustHaveValidSourceTestCase.java index 881ad36d718..2ca53668d26 100644 --- a/config-model/src/test/java/com/yahoo/schema/processing/SummaryFieldsMustHaveValidSourceTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/processing/SummaryFieldsMustHaveValidSourceTestCase.java @@ -24,7 +24,7 @@ public class SummaryFieldsMustHaveValidSourceTestCase extends AbstractSchemaTest ApplicationBuilder.buildFromFile("src/test/examples/invalidsummarysource.sd"); fail("This should throw and never get here"); } catch (IllegalArgumentException e) { - assertEquals("For schema 'invalidsummarysource', summary class 'baz', summary field 'cox': there is no valid source 'nonexistingfield'.", e.getMessage()); + assertEquals("For schema 'invalidsummarysource', document-summary 'baz', summary field 'cox': there is no valid source 'nonexistingfield'.", e.getMessage()); } } @@ -34,7 +34,7 @@ public class SummaryFieldsMustHaveValidSourceTestCase extends AbstractSchemaTest ApplicationBuilder.buildFromFile("src/test/examples/invalidimplicitsummarysource.sd"); fail("This should throw and never get here"); } catch (IllegalArgumentException e) { - assertEquals("For schema 'invalidsummarysource', summary class 'baz', summary field 'cox': there is no valid source 'cox'.", e.getMessage()); + assertEquals("For schema 'invalidsummarysource', document-summary 'baz', summary field 'cox': there is no valid source 'cox'.", e.getMessage()); } } @@ -44,7 +44,7 @@ public class SummaryFieldsMustHaveValidSourceTestCase extends AbstractSchemaTest ApplicationBuilder.buildFromFile("src/test/examples/invalidselfreferringsummary.sd"); fail("This should throw and never get here"); } catch (IllegalArgumentException e) { - assertEquals("For schema 'invalidselfreferringsummary', summary class 'withid', summary field 'w': there is no valid source 'w'.", e.getMessage()); + assertEquals("For schema 'invalidselfreferringsummary', document-summary 'withid', summary field 'w': there is no valid source 'w'.", e.getMessage()); } } |