diff options
38 files changed, 76 insertions, 189 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bdb3a23730..33cf9914a07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,7 +96,6 @@ vespa_install_data(tsan-suppressions.txt etc/vespa) # Include vespa config definitions in every target include_directories(BEFORE ${CMAKE_BINARY_DIR}/configdefinitions/src) -add_subdirectory(airlift-zstd) add_subdirectory(application-model) add_subdirectory(client) add_subdirectory(cloud-tenant-cd) diff --git a/client/js/app/yarn.lock b/client/js/app/yarn.lock index 4c3b5946c46..b812a8b8e37 100644 --- a/client/js/app/yarn.lock +++ b/client/js/app/yarn.lock @@ -1237,10 +1237,10 @@ dependencies: "@babel/runtime" "^7.13.10" -"@remix-run/router@1.10.0": - version "1.10.0" - resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.10.0.tgz#e2170dc2049b06e65bbe883adad0e8ddf8291278" - integrity sha512-Lm+fYpMfZoEucJ7cMxgt4dYt8jLfbpwRCzAjm9UgSLOkmlqo9gupxt6YX3DY0Fk155NT9l17d/ydi+964uS9Lw== +"@remix-run/router@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.11.0.tgz#e0e45ac3fff9d8a126916f166809825537e9f955" + integrity sha512-BHdhcWgeiudl91HvVa2wxqZjSHbheSgIiDvxrF1VjFzBzpTtuDPkOdOi3Iqvc08kXtFkLjhbS+ML9aM8mJS+wQ== "@sinclair/typebox@^0.27.8": version "0.27.8" @@ -4747,19 +4747,19 @@ react-remove-scroll@^2.5.5: use-sidecar "^1.1.2" react-router-dom@^6: - version "6.17.0" - resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.17.0.tgz#ea73f89186546c1cf72b10fcb7356d874321b2ad" - integrity sha512-qWHkkbXQX+6li0COUUPKAUkxjNNqPJuiBd27dVwQGDNsuFBdMbrS6UZ0CLYc4CsbdLYTckn4oB4tGDuPZpPhaQ== + version "6.18.0" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.18.0.tgz#0a50c167209d6e7bd2ed9de200a6579ea4fb1dca" + integrity sha512-Ubrue4+Ercc/BoDkFQfc6og5zRQ4A8YxSO3Knsne+eRbZ+IepAsK249XBH/XaFuOYOYr3L3r13CXTLvYt5JDjw== dependencies: - "@remix-run/router" "1.10.0" - react-router "6.17.0" + "@remix-run/router" "1.11.0" + react-router "6.18.0" -react-router@6.17.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.17.0.tgz#7b680c4cefbc425b57537eb9c73bedecbdc67c1e" - integrity sha512-YJR3OTJzi3zhqeJYADHANCGPUu9J+6fT5GLv82UWRGSxu6oJYCKVmxUcaBQuGm9udpWmPsvpme/CdHumqgsoaA== +react-router@6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.18.0.tgz#32e2bedc318e095a48763b5ed7758e54034cd36a" + integrity sha512-vk2y7Dsy8wI02eRRaRmOs9g2o+aE72YCx5q9VasT1N9v+lrdB79tIqrjMfByHiY5+6aYkH2rUa5X839nwWGPDg== dependencies: - "@remix-run/router" "1.10.0" + "@remix-run/router" "1.11.0" react-style-singleton@^2.2.1: version "2.2.1" diff --git a/cloud-tenant-base-dependencies-enforcer/pom.xml b/cloud-tenant-base-dependencies-enforcer/pom.xml index 08630c1eca5..ce673aea54e 100644 --- a/cloud-tenant-base-dependencies-enforcer/pom.xml +++ b/cloud-tenant-base-dependencies-enforcer/pom.xml @@ -110,7 +110,6 @@ <include>com.yahoo.vespa:vespalog:*:provided</include> <!-- Vespa test dependencies --> - <include>com.yahoo.vespa:airlift-zstd:*:test</include> <include>com.yahoo.vespa:application:*:test</include> <include>com.yahoo.vespa:cloud-tenant-cd:*:test</include> <include>com.yahoo.vespa:config-application-package:*:test</include> @@ -143,6 +142,7 @@ <include>com.microsoft.onnxruntime:onnxruntime:jar:${onnxruntime.vespa.version}:test</include> <include>com.thaiopensource:jing:20091111:test</include> <include>commons-codec:commons-codec:${commons-codec.vespa.version}:test</include> + <include>io.airlift:aircompressor:${aircompressor.vespa.version}:test</include> <include>io.airlift:airline:${airline.vespa.version}:test</include> <include>io.prometheus:simpleclient:${prometheus.client.vespa.version}:test</include> <include>io.prometheus:simpleclient_common:${prometheus.client.vespa.version}:test</include> diff --git a/config-model-fat/pom.xml b/config-model-fat/pom.xml index 3e12a4fccb5..db97d5d2e2c 100644 --- a/config-model-fat/pom.xml +++ b/config-model-fat/pom.xml @@ -138,7 +138,6 @@ <i>com.yahoo.vespa:fat-model-dependencies:*:*</i> <!-- Vespa artifacts embedded --> - <i>com.yahoo.vespa:airlift-zstd:*:*</i> <i>com.yahoo.vespa:annotations:*:*</i> <i>com.yahoo.vespa:component:*:*</i> <i>com.yahoo.vespa:config:*:*</i> @@ -196,6 +195,7 @@ <i>com.sun.xml.bind:jaxb-core:*:*</i> <i>com.sun.xml.bind:jaxb-impl:*:*</i> <i>com.thaiopensource:jing:*:*</i> + <i>io.airlift:aircompressor:*:*</i> <i>io.prometheus:simpleclient:*:*</i> <i>io.prometheus:simpleclient_common:*:*</i> <i>io.prometheus:simpleclient_tracer_common:*:*</i> 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()); } } diff --git a/configserver/pom.xml b/configserver/pom.xml index 7cf1c64326a..83cd725f142 100644 --- a/configserver/pom.xml +++ b/configserver/pom.xml @@ -34,9 +34,8 @@ <scope>test</scope> </dependency> <dependency> - <groupId>com.yahoo.vespa</groupId> - <artifactId>airlift-zstd</artifactId> - <version>${project.version}</version> + <groupId>io.airlift</groupId> + <artifactId>aircompressor</artifactId> </dependency> <dependency> <groupId>com.yahoo.vespa</groupId> @@ -216,7 +215,7 @@ <artifactId>bundle-plugin</artifactId> <extensions>true</extensions> <configuration> - <allowEmbeddedArtifacts>com.yahoo.vespa:airlift-zstd</allowEmbeddedArtifacts> + <allowEmbeddedArtifacts>io.airlift:aircompressor</allowEmbeddedArtifacts> </configuration> </plugin> <plugin> diff --git a/container-dependencies-enforcer/pom.xml b/container-dependencies-enforcer/pom.xml index 740332e766c..a56cd148b66 100644 --- a/container-dependencies-enforcer/pom.xml +++ b/container-dependencies-enforcer/pom.xml @@ -129,7 +129,6 @@ <include>com.yahoo.vespa:vespalog:*:provided</include> <!-- Vespa test dependencies --> - <include>com.yahoo.vespa:airlift-zstd:*:test</include> <include>com.yahoo.vespa:application:*:test</include> <include>com.yahoo.vespa:config-application-package:*:test</include> <include>com.yahoo.vespa:config-model-api:*:test</include> @@ -156,6 +155,7 @@ <include>com.microsoft.onnxruntime:onnxruntime:${onnxruntime.vespa.version}:test</include> <include>com.thaiopensource:jing:20091111:test</include> <include>commons-codec:commons-codec:${commons-codec.vespa.version}:test</include> + <include>io.airlift:aircompressor:${aircompressor.vespa.version}:test</include> <include>io.airlift:airline:${airline.vespa.version}:test</include> <include>io.prometheus:simpleclient:${prometheus.client.vespa.version}:test</include> <include>io.prometheus:simpleclient_common:${prometheus.client.vespa.version}:test</include> diff --git a/container-test/pom.xml b/container-test/pom.xml index baff67df3c0..3676b7a3280 100644 --- a/container-test/pom.xml +++ b/container-test/pom.xml @@ -49,9 +49,8 @@ for user projects must be added in compile scope here. These dependencies are explicitly excluded (or set to non-compile scope) in the container and/or container-dev modules. --> <dependency> - <groupId>com.yahoo.vespa</groupId> - <artifactId>airlift-zstd</artifactId> - <version>${project.version}</version> + <groupId>io.airlift</groupId> + <artifactId>aircompressor</artifactId> </dependency> <dependency> <groupId>com.ibm.icu</groupId> diff --git a/container/pom.xml b/container/pom.xml index 284745c1cd1..140a204bc83 100644 --- a/container/pom.xml +++ b/container/pom.xml @@ -35,8 +35,8 @@ <artifactId>asm</artifactId> </exclusion> <exclusion> - <groupId>com.yahoo.vespa</groupId> - <artifactId>airlift-zstd</artifactId> + <groupId>io.airlift</groupId> + <artifactId>aircompressor</artifactId> </exclusion> <exclusion> <groupId>net.java.dev.jna</groupId> diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/BillingController.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/BillingController.java index 8b48c72f88e..dcd1a057f49 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/BillingController.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/BillingController.java @@ -34,9 +34,6 @@ public interface BillingController { */ List<TenantName> tenantsWithPlan(List<TenantName> existing, PlanId planId); - /** The display name of the given plan */ - String getPlanDisplayName(PlanId planId); - /** * The quota for the given tenant. * This method will return default quota for tenants that do not exist. @@ -63,7 +60,6 @@ public interface BillingController { * @return The ID of the new bill. */ Bill.Id createBillForPeriod(TenantName tenant, ZonedDateTime startTime, ZonedDateTime endTime, String agent); - Bill.Id createBillForPeriod(TenantName tenant, LocalDate startDate, LocalDate endDate, String agent); /** * Create an unpersisted bill of unbilled use for the given tenant from the end of last bill until the given date. @@ -80,36 +76,15 @@ public interface BillingController { /** Get line items that have been manually added to a tenant, but is not yet part of a bill */ List<Bill.LineItem> getUnusedLineItems(TenantName tenant); - /** Get the payment instrument for the given tenant */ - Optional<PaymentInstrument> getDefaultInstrument(TenantName tenant); - - /** Get the auth token needed to talk to payment services */ - String createClientToken(String tenant, String userId); - - /** Delete a payment instrument from the list of the tenant's instruments */ - boolean deleteInstrument(TenantName tenant, String userId, String instrumentId); - - /** Change the status of the given bill */ - void updateBillStatus(Bill.Id billId, String agent, BillStatus status); - /** Add a line item to the given bill */ void addLineItem(TenantName tenant, String description, BigDecimal amount, Optional<Bill.Id> billId, String agent); /** Delete a line item - only available for unused line items */ void deleteLineItem(String lineItemId); - /** Set the given payment instrument as the active instrument for the tenant */ - boolean setActivePaymentInstrument(InstrumentOwner paymentInstrument); - - /** List the payment instruments from the tenant */ - InstrumentList listInstruments(TenantName tenant, String userId); - /** Get all bills for the given tenant */ List<Bill> getBillsForTenant(TenantName tenant); - /** Get all bills from the system */ - List<Bill> getBills(); - /** Get the bill with the given id */ Bill getBill(Bill.Id billId); diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/InstrumentList.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/InstrumentList.java deleted file mode 100644 index 559a3e8ee9c..00000000000 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/InstrumentList.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.hosted.controller.api.integration.billing; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author olaa - */ -public class InstrumentList { - - private String activeInstrumentId; - private List<PaymentInstrument> instruments; - - - public InstrumentList(List<PaymentInstrument> instruments) { - this.instruments = instruments; - } - - public void setActiveInstrumentId(String activeInstrumentId) { - this.activeInstrumentId = activeInstrumentId; - } - - public void addInstrument(PaymentInstrument instrument) { - instruments.add(instrument); - } - - public void addInstruments(List<PaymentInstrument> instruments) { - instruments.addAll(instruments); - } - - public String getActiveInstrumentId() { - return activeInstrumentId; - } - - public List<PaymentInstrument> getInstruments() { - return instruments; - } -} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/MockBillingController.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/MockBillingController.java index 9012b45748c..b50018c187c 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/MockBillingController.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/billing/MockBillingController.java @@ -28,7 +28,6 @@ public class MockBillingController implements BillingController { PlanId defaultPlan = PlanId.from("trial"); List<TenantName> tenants = new ArrayList<>(); Map<TenantName, PlanId> plans = new HashMap<>(); - Map<TenantName, PaymentInstrument> activeInstruments = new HashMap<>(); Map<TenantName, List<Bill>> committedBills = new HashMap<>(); public Map<TenantName, Bill> uncommittedBills = new HashMap<>(); Map<TenantName, List<Bill.LineItem>> unusedLineItems = new HashMap<>(); @@ -52,11 +51,6 @@ public class MockBillingController implements BillingController { } @Override - public String getPlanDisplayName(PlanId planId) { - return "Plan with id: " + planId.value(); - } - - @Override public Quota getQuota(TenantName tenant) { return Quota.unlimited().withMaxClusterSize(5); } @@ -83,11 +77,6 @@ public class MockBillingController implements BillingController { } @Override - public Bill.Id createBillForPeriod(TenantName tenant, LocalDate startDate, LocalDate endDate, String agent) { - return createBillForPeriod(tenant, startDate.atStartOfDay(ZoneOffset.UTC), endDate.plusDays(1).atStartOfDay(ZoneOffset.UTC), agent); - } - - @Override public Bill createUncommittedBill(TenantName tenant, LocalDate until) { return uncommittedBills.getOrDefault(tenant, emptyBill()); } @@ -103,31 +92,6 @@ public class MockBillingController implements BillingController { } @Override - public Optional<PaymentInstrument> getDefaultInstrument(TenantName tenant) { - return Optional.ofNullable(activeInstruments.get(tenant)); - } - - @Override - public String createClientToken(String tenant, String userId) { - return "some-token"; - } - - @Override - public boolean deleteInstrument(TenantName tenant, String userId, String instrumentId) { - activeInstruments.remove(tenant); - return true; - } - - @Override - public void updateBillStatus(Bill.Id billId, String agent, BillStatus status) { - var now = clock.instant().atZone(ZoneOffset.UTC); - committedBills.values().stream() - .flatMap(List::stream) - .filter(bill -> billId.equals(bill.id())) - .forEach(bill -> bill.statusHistory().history.put(now, status)); - } - - @Override public void addLineItem(TenantName tenant, String description, BigDecimal amount, Optional<Bill.Id> billId, String agent) { if (billId.isPresent()) { throw new UnsupportedOperationException(); @@ -152,28 +116,11 @@ public class MockBillingController implements BillingController { } @Override - public boolean setActivePaymentInstrument(InstrumentOwner paymentInstrument) { - var instrumentId = paymentInstrument.getPaymentInstrumentId(); - activeInstruments.put(paymentInstrument.getTenantName(), createInstrument(instrumentId)); - return true; - } - - @Override - public InstrumentList listInstruments(TenantName tenant, String userId) { - return null; - } - - @Override public List<Bill> getBillsForTenant(TenantName tenant) { return committedBills.getOrDefault(tenant, List.of()); } @Override - public List<Bill> getBills() { - return committedBills.values().stream().flatMap(Collection::stream).toList(); - } - - @Override public Bill getBill(Bill.Id billId) { return committedBills.values().stream() .flatMap(Collection::stream) diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java index 7f3ff06ce88..bdd89abfa4c 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java @@ -413,7 +413,7 @@ public class BillingApiHandlerV2 extends RestApiRequestHandler<BillingApiHandler if (response.isSuccess()) { return new MessageResponse("Plan: " + planId.value()); } else { - throw new RestApiException.BadRequest("Could not change plan: " + response.getErrorMessage()); + throw new RestApiException.BadRequest("Could not change plan: " + response.getErrorMessage().get()); } } diff --git a/dependency-versions/pom.xml b/dependency-versions/pom.xml index 8565a7a5451..4307e56eaec 100644 --- a/dependency-versions/pom.xml +++ b/dependency-versions/pom.xml @@ -53,6 +53,7 @@ <!-- Dependencies used internally in Vespa, not visible for users, or only visible in test classpath --> + <aircompressor.vespa.version>0.25</aircompressor.vespa.version> <airline.vespa.version>0.9</airline.vespa.version> <antlr.vespa.version>3.5.3</antlr.vespa.version> <antlr4.vespa.version>4.13.1</antlr4.vespa.version> @@ -65,7 +66,7 @@ <assertj.vespa.version>3.24.2</assertj.vespa.version> <!-- Athenz dependencies. Make sure these dependencies match those in Vespa's internal repositories --> - <athenz.vespa.version>1.11.44</athenz.vespa.version> + <athenz.vespa.version>1.11.45</athenz.vespa.version> <aws-sdk.vespa.version>1.12.565</aws-sdk.vespa.version> <!-- Athenz END --> diff --git a/dist/vespa.spec b/dist/vespa.spec index cd1381fd48d..7cef6b4d045 100644 --- a/dist/vespa.spec +++ b/dist/vespa.spec @@ -652,7 +652,6 @@ fi %dir %{_prefix} %dir %{_prefix}/lib %dir %{_prefix}/lib/jars -%{_prefix}/lib/jars/airlift-zstd.jar %{_prefix}/lib/jars/application-model-jar-with-dependencies.jar %{_prefix}/lib/jars/bc*-jdk18on-*.jar %{_prefix}/lib/jars/config-bundle-jar-with-dependencies.jar diff --git a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceCompressor.java b/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceCompressor.java index 7104567cb05..bcfeddacff3 100644 --- a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceCompressor.java +++ b/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceCompressor.java @@ -1,7 +1,7 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.filedistribution; -import ai.vespa.airlift.zstd.ZstdInputStream; +import io.airlift.compress.zstd.ZstdInputStream; import com.yahoo.compress.ZstdOutputStream; import net.jpountz.lz4.LZ4BlockInputStream; import net.jpountz.lz4.LZ4BlockOutputStream; diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/sync/ZstdCompressingInputStream.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/sync/ZstdCompressingInputStream.java index 6eed21c8865..eeec7e1b59c 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/sync/ZstdCompressingInputStream.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/sync/ZstdCompressingInputStream.java @@ -14,7 +14,7 @@ import java.io.InputStream; public class ZstdCompressingInputStream extends InputStream { public static final int DEFAULT_INPUT_BUFFER_SIZE = 8 * 1024; - static final ZstdCompressor compressor = new ZstdCompressor(); + private final ZstdCompressor compressor = new ZstdCompressor(); private final InputStream is; private final byte[] inputBuffer; diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/sync/ZstdCompressingInputStreamTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/sync/ZstdCompressingInputStreamTest.java index 68a71a65a27..616100363e9 100644 --- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/sync/ZstdCompressingInputStreamTest.java +++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/maintenance/sync/ZstdCompressingInputStreamTest.java @@ -1,6 +1,7 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.node.admin.maintenance.sync; +import com.yahoo.compress.ZstdCompressor; import org.junit.jupiter.api.Test; import java.io.ByteArrayInputStream; @@ -9,7 +10,6 @@ import java.io.IOException; import java.io.UncheckedIOException; import java.util.Random; -import static com.yahoo.vespa.hosted.node.admin.maintenance.sync.ZstdCompressingInputStream.compressor; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -35,6 +35,7 @@ public class ZstdCompressingInputStreamTest { private static void assertCompression(byte[] data, int bufferSize) { byte[] compressedData = compress(data, bufferSize); byte[] decompressedData = new byte[data.length]; + var compressor = new ZstdCompressor(); compressor.decompress(compressedData, 0, compressedData.length, decompressedData, 0, decompressedData.length); assertArrayEquals(data, decompressedData); diff --git a/parent/pom.xml b/parent/pom.xml index 4772650e48e..45d25fc42ce 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -317,7 +317,7 @@ --> <groupId>org.openrewrite.maven</groupId> <artifactId>rewrite-maven-plugin</artifactId> - <version>5.9.1</version> + <version>5.10.0</version> <configuration> <activeRecipes> <recipe>org.openrewrite.java.testing.junit5.JUnit5BestPractices</recipe> @@ -675,6 +675,11 @@ </dependency> <dependency> <groupId>io.airlift</groupId> + <artifactId>aircompressor</artifactId> + <version>${aircompressor.vespa.version}</version> + </dependency> + <dependency> + <groupId>io.airlift</groupId> <artifactId>airline</artifactId> <version>${airline.vespa.version}</version> </dependency> @@ -1121,7 +1126,7 @@ See pluginManagement of rewrite-maven-plugin for more details --> <groupId>org.openrewrite.recipe</groupId> <artifactId>rewrite-recipe-bom</artifactId> - <version>2.4.0</version> + <version>2.4.1</version> <type>pom</type> <scope>import</scope> </dependency> @@ -24,7 +24,6 @@ </developers> <modules> - <module>airlift-zstd</module> <module>application</module> <module>application-model</module> <module>bundle-plugin-test</module> diff --git a/screwdriver.yaml b/screwdriver.yaml index b6e0fa5f35b..3733fa58476 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -547,8 +547,6 @@ jobs: while read f; do (echo -e "---\nrender_with_liquid: false\n---\n"; cat ${f})>${f}.new; mv ${f}.new ${f}; done - build-site: | bundle exec jekyll build - - ignore-files: | - rm -rf _site/airlift-zstd - check-links: | bundle exec htmlproofer \ --assume-extension --check-html --check-external-hash --no-enforce-http \ diff --git a/vespa-dependencies-enforcer/allowed-maven-dependencies.txt b/vespa-dependencies-enforcer/allowed-maven-dependencies.txt index 1fc7fabc161..844c0adabc0 100644 --- a/vespa-dependencies-enforcer/allowed-maven-dependencies.txt +++ b/vespa-dependencies-enforcer/allowed-maven-dependencies.txt @@ -51,6 +51,7 @@ commons-collections:commons-collections:${commons-collections.vespa.version} commons-fileupload:commons-fileupload:1.5 commons-io:commons-io:${commons-io.vespa.version} commons-logging:commons-logging:${commons-logging.vespa.version} +io.airlift:aircompressor:${aircompressor.vespa.version} io.airlift:airline:${airline.vespa.version} io.dropwizard.metrics:metrics-core:${dropwizard.metrics.vespa.version} io.jsonwebtoken:jjwt-api:${java-jjwt.vespa.version} diff --git a/vespaclient-java/src/main/java/com/yahoo/vespa/security/tool/crypto/CipherUtils.java b/vespaclient-java/src/main/java/com/yahoo/vespa/security/tool/crypto/CipherUtils.java index 36900f65e72..f2debef61e3 100644 --- a/vespaclient-java/src/main/java/com/yahoo/vespa/security/tool/crypto/CipherUtils.java +++ b/vespaclient-java/src/main/java/com/yahoo/vespa/security/tool/crypto/CipherUtils.java @@ -1,7 +1,7 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.security.tool.crypto; -import ai.vespa.airlift.zstd.ZstdInputStream; +import io.airlift.compress.zstd.ZstdInputStream; import com.yahoo.compress.ZstdOutputStream; import com.yahoo.security.AeadCipher; diff --git a/vespajlib/pom.xml b/vespajlib/pom.xml index 99924fe36c3..16ae251aa8b 100644 --- a/vespajlib/pom.xml +++ b/vespajlib/pom.xml @@ -32,9 +32,9 @@ <artifactId>jna</artifactId> </dependency> <dependency> - <groupId>com.yahoo.vespa</groupId> - <artifactId>airlift-zstd</artifactId> - <version>${project.version}</version> + <groupId>io.airlift</groupId> + <artifactId>aircompressor</artifactId> + <version>${aircompressor.vespa.version}</version> </dependency> <dependency> <groupId>net.openhft</groupId> diff --git a/vespajlib/src/main/java/com/yahoo/compress/Compressor.java b/vespajlib/src/main/java/com/yahoo/compress/Compressor.java index 1a9078e640e..1aca29cd21b 100644 --- a/vespajlib/src/main/java/com/yahoo/compress/Compressor.java +++ b/vespajlib/src/main/java/com/yahoo/compress/Compressor.java @@ -19,7 +19,6 @@ import java.util.Random; */ public class Compressor { - private final ZstdCompressor zstdCompressor = new ZstdCompressor(); private final CompressionType type; private final int level; private final double compressionThresholdFactor; @@ -101,6 +100,7 @@ public class Compressor { if (len < compressMinSizeBytes) { return compact(CompressionType.INCOMPRESSIBLE, data, offset, len); } + ZstdCompressor zstdCompressor = new ZstdCompressor(); byte[] compressed = zstdCompressor.compress(data, offset, len); return new Compression(CompressionType.ZSTD, len, compressed); default: @@ -151,6 +151,7 @@ public class Compressor { return uncompressedLZ4Data; case ZSTD: int compressedLength = expectedCompressedSize.orElseThrow(() -> new IllegalArgumentException("Zstd decompressor requires input size")); + ZstdCompressor zstdCompressor = new ZstdCompressor(); byte[] decompressedData = zstdCompressor.decompress(compressedData, compressedDataOffset, compressedLength); expectedCompressedSize.ifPresent(expectedSize -> { if (compressedData.length != expectedSize) { diff --git a/vespajlib/src/main/java/com/yahoo/compress/ZstdCompressor.java b/vespajlib/src/main/java/com/yahoo/compress/ZstdCompressor.java index 5bec9aa4e8a..245a672de20 100644 --- a/vespajlib/src/main/java/com/yahoo/compress/ZstdCompressor.java +++ b/vespajlib/src/main/java/com/yahoo/compress/ZstdCompressor.java @@ -11,8 +11,8 @@ import java.util.Arrays; */ public class ZstdCompressor { - private static final ai.vespa.airlift.zstd.ZstdCompressor compressor = new ai.vespa.airlift.zstd.ZstdCompressor(); - private static final ai.vespa.airlift.zstd.ZstdDecompressor decompressor = new ai.vespa.airlift.zstd.ZstdDecompressor(); + private io.airlift.compress.zstd.ZstdCompressor compressor = new io.airlift.compress.zstd.ZstdCompressor(); + private io.airlift.compress.zstd.ZstdDecompressor decompressor = new io.airlift.compress.zstd.ZstdDecompressor(); public byte[] compress(byte[] input, int inputOffset, int inputLength) { int maxCompressedLength = getMaxCompressedLength(inputLength); @@ -41,12 +41,14 @@ public class ZstdCompressor { return decompressor.decompress(input, inputOffset, inputLength, output, outputOffset, maxOutputLength); } + private static final io.airlift.compress.Compressor threadUnsafe = new io.airlift.compress.zstd.ZstdCompressor(); + public static int getMaxCompressedLength(int uncompressedLength) { - return compressor.maxCompressedLength(uncompressedLength); + return threadUnsafe.maxCompressedLength(uncompressedLength); } public static int getDecompressedLength(byte[] input, int inputOffset, int inputLength) { - return (int) ai.vespa.airlift.zstd.ZstdDecompressor.getDecompressedSize(input, inputOffset, inputLength); + return (int) io.airlift.compress.zstd.ZstdDecompressor.getDecompressedSize(input, inputOffset, inputLength); } } |