From 642c86a868689e2151ab7d83e73c76dcf7a16147 Mon Sep 17 00:00:00 2001 From: Katia Aresti Date: Tue, 28 Jul 2020 15:14:59 +0200 Subject: [PATCH] Upgrade Infinispan to 11.0.1.Final --- bom/application/pom.xml | 4 ++-- .../client/deployment/InfinispanClientProcessor.java | 2 +- .../client/runtime/InfinispanClientProducer.java | 6 +++--- .../runtime/graal/SubstituteConfigurationBuilder.java | 7 ++----- .../client/runtime/graal/SubstituteRemoteCacheImpl.java | 5 +++-- .../runtime/graal/SubstituteRemoteCacheManager.java | 7 +++---- integration-tests/infinispan-client/pom.xml | 6 +++--- .../infinispan/client/InfinispanServerTestResource.java | 9 +++++++-- 8 files changed, 24 insertions(+), 22 deletions(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 3f879915b7db3..bb983d3e8e1c4 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -123,8 +123,8 @@ 6.14.2 3.16.1 2.3 - 10.1.5.Final - 4.3.2.Final + 11.0.1.Final + 4.3.3.Final 2.8.5 4.1.49.Final 1.0.3 diff --git a/extensions/infinispan-client/deployment/src/main/java/io/quarkus/infinispan/client/deployment/InfinispanClientProcessor.java b/extensions/infinispan-client/deployment/src/main/java/io/quarkus/infinispan/client/deployment/InfinispanClientProcessor.java index b961c6c5bdbcc..157d9ba1f73fc 100644 --- a/extensions/infinispan-client/deployment/src/main/java/io/quarkus/infinispan/client/deployment/InfinispanClientProcessor.java +++ b/extensions/infinispan-client/deployment/src/main/java/io/quarkus/infinispan/client/deployment/InfinispanClientProcessor.java @@ -20,7 +20,7 @@ import org.infinispan.client.hotrod.impl.ConfigurationProperties; import org.infinispan.client.hotrod.logging.Log; import org.infinispan.client.hotrod.logging.LogFactory; -import org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller; +import org.infinispan.commons.marshall.ProtoStreamMarshaller; import org.infinispan.commons.util.Util; import org.infinispan.protostream.BaseMarshaller; import org.infinispan.protostream.EnumMarshaller; diff --git a/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientProducer.java b/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientProducer.java index 7f939bc0c4b45..706177467462a 100644 --- a/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientProducer.java +++ b/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientProducer.java @@ -25,8 +25,8 @@ import org.infinispan.client.hotrod.impl.ConfigurationProperties; import org.infinispan.client.hotrod.logging.Log; import org.infinispan.client.hotrod.logging.LogFactory; -import org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller; import org.infinispan.commons.marshall.Marshaller; +import org.infinispan.commons.marshall.ProtoStreamMarshaller; import org.infinispan.commons.util.Util; import org.infinispan.counter.api.CounterManager; import org.infinispan.protostream.BaseMarshaller; @@ -296,10 +296,10 @@ void configure(Properties properties) { } /** - * Retrieves the deprecated {@link Remote} annotation instance from the set + * Retrieves the deprecated {@link io.quarkus.infinispan.client.Remote} annotation instance from the set * * @param annotationSet the annotation set. - * @return the {@link Remote} annotation instance or {@code null} if not found. + * @return the {@link io.quarkus.infinispan.client.Remote} annotation instance or {@code null} if not found. */ private io.quarkus.infinispan.client.Remote getRemoteAnnotation(Set annotationSet) { for (Annotation annotation : annotationSet) { diff --git a/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/graal/SubstituteConfigurationBuilder.java b/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/graal/SubstituteConfigurationBuilder.java index be0d8b24464cd..029f1f4ade0f8 100644 --- a/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/graal/SubstituteConfigurationBuilder.java +++ b/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/graal/SubstituteConfigurationBuilder.java @@ -4,7 +4,6 @@ import org.infinispan.client.hotrod.marshall.BytesOnlyMarshaller; import org.infinispan.commons.marshall.Marshaller; -import com.oracle.svm.core.annotate.Alias; import com.oracle.svm.core.annotate.Substitute; import com.oracle.svm.core.annotate.TargetClass; @@ -15,11 +14,9 @@ */ @TargetClass(ConfigurationBuilder.class) public final class SubstituteConfigurationBuilder { - @Alias - private Marshaller marshaller; @Substitute - private void handleNullMarshaller() { - marshaller = BytesOnlyMarshaller.INSTANCE; + private Marshaller handleNullMarshaller() { + return BytesOnlyMarshaller.INSTANCE; } } diff --git a/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/graal/SubstituteRemoteCacheImpl.java b/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/graal/SubstituteRemoteCacheImpl.java index 363f2211385af..ecec2b9261992 100644 --- a/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/graal/SubstituteRemoteCacheImpl.java +++ b/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/graal/SubstituteRemoteCacheImpl.java @@ -2,6 +2,7 @@ import javax.management.ObjectName; +import org.infinispan.client.hotrod.configuration.Configuration; import org.infinispan.client.hotrod.impl.RemoteCacheImpl; import org.infinispan.client.hotrod.impl.operations.OperationsFactory; import org.infinispan.commons.marshall.Marshaller; @@ -31,7 +32,7 @@ private void unregisterMBean() { // Sadly this method is public, so technically a user could get a Runtime error if they were referencing // it before - but it is the only way to make graal happy @Delete - public void init(Marshaller marshaller, OperationsFactory operationsFactory, int estimateKeySize, - int estimateValueSize, int batchSize, ObjectName jmxParent) { + public void init(Marshaller marshaller, OperationsFactory operationsFactory, + Configuration configuration, ObjectName jmxParent) { } } diff --git a/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/graal/SubstituteRemoteCacheManager.java b/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/graal/SubstituteRemoteCacheManager.java index 79470706b5109..26625d6656b9f 100644 --- a/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/graal/SubstituteRemoteCacheManager.java +++ b/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/graal/SubstituteRemoteCacheManager.java @@ -2,7 +2,7 @@ import org.infinispan.client.hotrod.RemoteCacheManager; import org.infinispan.client.hotrod.configuration.Configuration; -import org.infinispan.client.hotrod.impl.RemoteCacheImpl; +import org.infinispan.client.hotrod.impl.InternalRemoteCache; import org.infinispan.client.hotrod.impl.operations.OperationsFactory; import org.infinispan.commons.marshall.Marshaller; @@ -23,10 +23,9 @@ public final class SubstituteRemoteCacheManager { private Configuration configuration; @Substitute - private void initRemoteCache(RemoteCacheImpl remoteCache, OperationsFactory operationsFactory) { + private void initRemoteCache(InternalRemoteCache remoteCache, OperationsFactory operationsFactory) { // Invoke the init method that doesn't have the JMX ObjectName argument - remoteCache.init(marshaller, operationsFactory, configuration.keySizeEstimate(), - configuration.valueSizeEstimate(), configuration.batchSize()); + remoteCache.init(marshaller, operationsFactory, configuration); } @Substitute diff --git a/integration-tests/infinispan-client/pom.xml b/integration-tests/infinispan-client/pom.xml index 866793de3b908..a943c6d7a7683 100644 --- a/integration-tests/infinispan-client/pom.xml +++ b/integration-tests/infinispan-client/pom.xml @@ -95,17 +95,17 @@ com.fasterxml.jackson.core jackson-core - 2.10.0 + 2.11.0 com.fasterxml.jackson.core jackson-databind - 2.10.0 + 2.11.0 com.fasterxml.jackson.core jackson-annotations - 2.10.0 + 2.11.0 diff --git a/integration-tests/infinispan-client/src/test/java/io/quarkus/it/infinispan/client/InfinispanServerTestResource.java b/integration-tests/infinispan-client/src/test/java/io/quarkus/it/infinispan/client/InfinispanServerTestResource.java index 6bcba082209b2..f519c49f5081a 100644 --- a/integration-tests/infinispan-client/src/test/java/io/quarkus/it/infinispan/client/InfinispanServerTestResource.java +++ b/integration-tests/infinispan-client/src/test/java/io/quarkus/it/infinispan/client/InfinispanServerTestResource.java @@ -3,6 +3,7 @@ import java.util.Collections; import java.util.Map; +import org.infinispan.commons.dataconversion.MediaType; import org.infinispan.commons.test.TestResourceTracker; import org.infinispan.configuration.cache.ConfigurationBuilder; import org.infinispan.configuration.global.GlobalConfigurationBuilder; @@ -23,10 +24,14 @@ public class InfinispanServerTestResource implements QuarkusTestResourceLifecycl @Override public Map start() { TestResourceTracker.setThreadTestName("InfinispanServer"); + ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(); + configurationBuilder.encoding().mediaType(MediaType.APPLICATION_PROTOSTREAM_TYPE); EmbeddedCacheManager ecm = TestCacheManagerFactory.createCacheManager( new GlobalConfigurationBuilder().nonClusteredDefault().defaultCacheName("default"), - new ConfigurationBuilder()); - ecm.defineConfiguration("magazine", new ConfigurationBuilder().build()); + configurationBuilder); + + ecm.defineConfiguration("magazine", configurationBuilder.build()); + // Client connects to a non default port final HotRodServerConfigurationBuilder hotRodServerConfigurationBuilder = new HotRodServerConfigurationBuilder(); hotRodServerConfigurationBuilder