diff --git a/dependencies/pom.xml b/dependencies/pom.xml index 038de9fa210..9485687a06f 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -122,7 +122,7 @@ 3.0 3.0 2.0-RC1 - 05.00.02-MS-GA + 08.01.01-MS-GA 1.11.0 8.4.1.jre8 8.2.0 @@ -736,6 +736,11 @@ microstream-cache ${version.lib.microstream} + + one.microstream + microstream-persistence-binary-jdk17 + ${version.lib.microstream} + diff --git a/integrations/microstream/README.md b/integrations/microstream/README.md index 82af35317ea..b4a64d56ec5 100644 --- a/integrations/microstream/README.md +++ b/integrations/microstream/README.md @@ -2,7 +2,7 @@ This projects add [Microstream](https://microstream.one) support to Helidon. -The offical [Microstream documentation](https://manual.docs.microstream.one/) can be found here. +The official [Microstream documentation](https://manual.docs.microstream.one/) can be found here. ## helidon-integrations-microstream diff --git a/integrations/microstream/cache/src/main/java/io/helidon/integrations/microstream/cache/MicrostreamCacheConfigurationBuilder.java b/integrations/microstream/cache/src/main/java/io/helidon/integrations/microstream/cache/MicrostreamCacheConfigurationBuilder.java index 89f5152ede4..6b66c2cb263 100644 --- a/integrations/microstream/cache/src/main/java/io/helidon/integrations/microstream/cache/MicrostreamCacheConfigurationBuilder.java +++ b/integrations/microstream/cache/src/main/java/io/helidon/integrations/microstream/cache/MicrostreamCacheConfigurationBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Oracle and/or its affiliates. + * Copyright (c) 2021, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,6 @@ package io.helidon.integrations.microstream.cache; -import java.lang.reflect.Field; -import java.util.function.Predicate; - import javax.cache.configuration.CacheEntryListenerConfiguration; import javax.cache.configuration.Factory; import javax.cache.expiry.ExpiryPolicy; @@ -33,6 +30,7 @@ import one.microstream.cache.types.CacheConfigurationPropertyNames; import one.microstream.cache.types.EvictionManager; import one.microstream.configuration.types.Configuration; +import one.microstream.persistence.binary.util.SerializerFoundation; /** * Builder for Microstream-CacheConfigurations. @@ -89,7 +87,7 @@ public static MicrostreamCacheConfigurationBuilder builder(Class * * @param type of the cache key * @param type of the cache value - * @param config helidon configuation + * @param config helidon configuration * @param keyType type of the cache key * @param valueType type of the cache value * @return a new CacheConfiguration builder @@ -171,10 +169,8 @@ public MicrostreamCacheConfigurationBuilder cacheWriterFactory( } @Override - public MicrostreamCacheConfigurationBuilder serializerFieldPredicate( - Predicate serializerFieldPredicate) { - cacheConfigBuilder.serializerFieldPredicate(serializerFieldPredicate); - return this; + public Builder serializerFoundation(SerializerFoundation serializerFoundation) { + return cacheConfigBuilder.serializerFoundation(serializerFoundation); } @Override @@ -185,7 +181,7 @@ public Builder addListenerConfiguration(CacheEntryListenerConfiguration actualType) { if (!typeName.equals(actualType.getTypeName())) { - throw new ConfigException("Microstream cache-config type missmatch, expected value from configuration: " + typeName + throw new ConfigException("Microstream cache-config type mismatch, expected value from configuration: " + typeName + " but got: " + actualType.getTypeName()); } } diff --git a/integrations/microstream/cache/src/test/java/io/helidon/integrations/microstream/cache/ConfigurationTest.java b/integrations/microstream/cache/src/test/java/io/helidon/integrations/microstream/cache/ConfigurationTest.java index 601a2e42438..9dbf296caf9 100644 --- a/integrations/microstream/cache/src/test/java/io/helidon/integrations/microstream/cache/ConfigurationTest.java +++ b/integrations/microstream/cache/src/test/java/io/helidon/integrations/microstream/cache/ConfigurationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Oracle and/or its affiliates. + * Copyright (c) 2021, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,7 @@ package io.helidon.integrations.microstream.cache; -import java.lang.reflect.Field; import java.util.Map; -import java.util.function.Predicate; import javax.cache.configuration.Factory; import javax.cache.expiry.ExpiryPolicy; @@ -65,9 +63,7 @@ void defaultValuesTest() { () -> assertThat("getCacheLoaderFactory", cacheConfig.getCacheLoaderFactory(), nullValue()), () -> assertThat("getCacheWriterFactory", cacheConfig.getCacheWriterFactory(), nullValue()), () -> assertThat("getCacheEntryListenerConfigurations", - cacheConfig.getCacheEntryListenerConfigurations(), emptyIterable()), - () -> assertThat("getSerializerFieldPredicate", cacheConfig.getSerializerFieldPredicate(), - is(CacheConfiguration.DefaultSerializerFieldPredicate()))); + cacheConfig.getCacheEntryListenerConfigurations(), emptyIterable())); } /** @@ -154,14 +150,4 @@ void evictionManagerFactoryTest() { assertThat(cacheConfig.getEvictionManagerFactory(), sameInstance(evictionManagerFactory)); } - @Test - void serializerFieldPredicate() { - @SuppressWarnings("unchecked") - Predicate serializerFieldPredicate = Mockito.mock(Predicate.class); - - CacheConfiguration cacheConfig = MicrostreamCacheConfigurationBuilder - .builder(Integer.class, String.class).serializerFieldPredicate(serializerFieldPredicate).build(); - - assertThat(cacheConfig.getSerializerFieldPredicate(), sameInstance(serializerFieldPredicate)); - } } diff --git a/integrations/microstream/cdi/src/main/java/io/helidon/integrations/microstream/cdi/CacheExtension.java b/integrations/microstream/cdi/src/main/java/io/helidon/integrations/microstream/cdi/CacheExtension.java index dc35abf204c..113da60bf8a 100644 --- a/integrations/microstream/cdi/src/main/java/io/helidon/integrations/microstream/cdi/CacheExtension.java +++ b/integrations/microstream/cdi/src/main/java/io/helidon/integrations/microstream/cdi/CacheExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Oracle and/or its affiliates. + * Copyright (c) 2021, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -100,10 +100,8 @@ private void addBeans(@Observes final AfterBeanDiscovery event, final BeanManage .scope(ApplicationScoped.class) .addTransitiveTypeClosure(Cache.class) .addTypes(types) - .createWith(cc -> { - return CacheBuilder.create(name, getConfigNode(qualifiers), keyType.rawType(), - valueType.rawType()); - }) + .createWith(cc -> CacheBuilder.create(name, getConfigNode(qualifiers), keyType.rawType(), + valueType.rawType())) .destroyWith((cache, context) -> cache.close()); } } diff --git a/integrations/microstream/cdi/src/main/java/io/helidon/integrations/microstream/cdi/EmbeddedStorageManagerExtension.java b/integrations/microstream/cdi/src/main/java/io/helidon/integrations/microstream/cdi/EmbeddedStorageManagerExtension.java index 7045e114f8f..428f16e24d3 100644 --- a/integrations/microstream/cdi/src/main/java/io/helidon/integrations/microstream/cdi/EmbeddedStorageManagerExtension.java +++ b/integrations/microstream/cdi/src/main/java/io/helidon/integrations/microstream/cdi/EmbeddedStorageManagerExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Oracle and/or its affiliates. + * Copyright (c) 2021, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,9 +89,7 @@ private void addBeans(@Observes final AfterBeanDiscovery event, final BeanManage .addTransitiveTypeClosure(EmbeddedStorageManager.class) .beanClass(EmbeddedStorageManager.class) .qualifiers(qualifiers) - .createWith(cc -> { - return EmbeddedStorageManagerBuilder.create(getConfigNode(qualifiers)).start(); - }) + .createWith(cc -> EmbeddedStorageManagerBuilder.create(getConfigNode(qualifiers)).start()) .destroyWith((storageManager, context) -> storageManager.shutdown()); } } diff --git a/integrations/microstream/cdi/src/main/java/module-info.java b/integrations/microstream/cdi/src/main/java/module-info.java index 75b4cf6cc4c..b6845628906 100644 --- a/integrations/microstream/cdi/src/main/java/module-info.java +++ b/integrations/microstream/cdi/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Oracle and/or its affiliates. + * Copyright (c) 2021, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,10 +29,7 @@ requires transitive jakarta.inject; requires jakarta.interceptor.api; requires jakarta.annotation; - requires microstream.base; requires microstream.cache; - requires microstream.persistence; - requires microstream.storage; requires microstream.storage.embedded; provides jakarta.enterprise.inject.spi.Extension diff --git a/integrations/microstream/core/pom.xml b/integrations/microstream/core/pom.xml index ef380157487..d5e492f519a 100644 --- a/integrations/microstream/core/pom.xml +++ b/integrations/microstream/core/pom.xml @@ -44,6 +44,10 @@ one.microstream microstream-configuration + + one.microstream + microstream-persistence-binary-jdk17 + io.helidon.config helidon-config diff --git a/integrations/microstream/core/src/main/java/module-info.java b/integrations/microstream/core/src/main/java/module-info.java index 537ed098ca3..b11194957cd 100644 --- a/integrations/microstream/core/src/main/java/module-info.java +++ b/integrations/microstream/core/src/main/java/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Oracle and/or its affiliates. + * Copyright (c) 2021, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,5 +28,6 @@ requires transitive microstream.storage; requires transitive microstream.storage.embedded; requires transitive microstream.storage.embedded.configuration; + requires microstream.persistence.binary.jdk17; } \ No newline at end of file diff --git a/integrations/microstream/metrics/src/main/java/io/helidon/integrations/microstream/metrics/MicrostreamMetricsSupport.java b/integrations/microstream/metrics/src/main/java/io/helidon/integrations/microstream/metrics/MicrostreamMetricsSupport.java index 5ec42fd0170..56e728c28ca 100644 --- a/integrations/microstream/metrics/src/main/java/io/helidon/integrations/microstream/metrics/MicrostreamMetricsSupport.java +++ b/integrations/microstream/metrics/src/main/java/io/helidon/integrations/microstream/metrics/MicrostreamMetricsSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022 Oracle and/or its affiliates. + * Copyright (c) 2021, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ public class MicrostreamMetricsSupport { private static final String CONFIG_METRIC_ENABLED_VENDOR = "vendor."; - static final String BASE_ENABLED_KEY = CONFIG_METRIC_ENABLED_VENDOR + "enabled"; private static final Metadata GLOBAL_FILE_COUNT = Metadata.builder() .withName("microstream.globalFileCount")