diff --git a/artemis-features/src/main/resources/features.xml b/artemis-features/src/main/resources/features.xml index 28cf1b6a61a..87da8a86cb7 100644 --- a/artemis-features/src/main/resources/features.xml +++ b/artemis-features/src/main/resources/features.xml @@ -73,6 +73,7 @@ mvn:org.apache.commons/commons-text/${commons.text.version} mvn:org.apache.commons/commons-lang3/${commons.lang.version} mvn:org.jctools/jctools-core/${jctools.version} + mvn:org.jctools/jctools-core-jdk11/${jctools.version} mvn:org.hdrhistogram/HdrHistogram/${hdrhistogram.version} mvn:com.github.ben-manes.caffeine/caffeine/${caffeine.version} mvn:org.apache.commons/commons-dbcp2/${commons.dbcp2.version} diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java index f06c5f2d219..a024e60aa43 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java @@ -42,7 +42,7 @@ import org.apache.activemq.artemis.core.journal.impl.SimpleWaitIOCallback; import org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent; import org.apache.activemq.artemis.utils.ReusableLatch; -import org.jctools.queues.MpscUnboundedArrayQueue; +import org.jctools.queues.varhandle.MpscUnboundedVarHandleArrayQueue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -75,7 +75,7 @@ public class JDBCSequentialFile implements SequentialFile { private final JDBCSequentialFileFactoryDriver dbDriver; - MpscUnboundedArrayQueue writeQueue = new MpscUnboundedArrayQueue<>(8192); + MpscUnboundedVarHandleArrayQueue writeQueue = new MpscUnboundedVarHandleArrayQueue<>(8192); // Allows DB Drivers to cache meta data. private final Map metaData = new ConcurrentHashMap<>(); diff --git a/artemis-journal/pom.xml b/artemis-journal/pom.xml index be848f12b91..e107cd6948c 100644 --- a/artemis-journal/pom.xml +++ b/artemis-journal/pom.xml @@ -54,7 +54,7 @@ org.jctools - jctools-core + jctools-core-jdk11 org.apache.activemq diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java index 6917a0013f1..a0f9efd1726 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java @@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; import org.slf4j.Logger; -import org.jctools.queues.MpmcArrayQueue; +import org.jctools.queues.varhandle.MpmcVarHandleArrayQueue; import org.jctools.queues.atomic.MpmcAtomicArrayQueue; public final class AIOSequentialFileFactory extends AbstractSequentialFileFactory { @@ -115,7 +115,7 @@ public AIOSequentialFileFactory(final File journalDir, logger.warn("Using journal-max-io 1 isn't a proper use of ASYNCIO journal: consider rise this value or use NIO."); } final int adjustedMaxIO = Math.max(2, maxIO); - callbackPool = PlatformDependent.hasUnsafe() ? new MpmcArrayQueue<>(adjustedMaxIO) : new MpmcAtomicArrayQueue<>(adjustedMaxIO); + callbackPool = PlatformDependent.hasUnsafe() ? new MpmcVarHandleArrayQueue<>(adjustedMaxIO) : new MpmcAtomicArrayQueue<>(adjustedMaxIO); logger.trace("New AIO File Created"); } diff --git a/artemis-pom/pom.xml b/artemis-pom/pom.xml index 840e56977aa..265f5805c80 100644 --- a/artemis-pom/pom.xml +++ b/artemis-pom/pom.xml @@ -413,7 +413,7 @@ org.jctools - jctools-core + jctools-core-jdk11 ${jctools.version} diff --git a/artemis-server/pom.xml b/artemis-server/pom.xml index 2338bf80bb7..db1b3904208 100644 --- a/artemis-server/pom.xml +++ b/artemis-server/pom.xml @@ -92,7 +92,7 @@ org.jctools - jctools-core + jctools-core-jdk11 io.netty diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java index 98b93070f92..ffb60c996cd 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java @@ -123,7 +123,7 @@ import org.apache.activemq.artemis.utils.collections.PriorityLinkedListImpl; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.apache.activemq.artemis.utils.critical.CriticalComponentImpl; -import org.jctools.queues.MpscUnboundedArrayQueue; +import org.jctools.queues.varhandle.MpscUnboundedVarHandleArrayQueue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -201,7 +201,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue { // Messages will first enter intermediateMessageReferences before they are added to messageReferences. This is to // avoid locking the queue on the producer - private final MpscUnboundedArrayQueue intermediateMessageReferences; + private final MpscUnboundedVarHandleArrayQueue intermediateMessageReferences; // This is where messages are stored protected final PriorityLinkedList messageReferences = new PriorityLinkedListImpl<>(QueueImpl.NUM_PRIORITIES, MessageReferenceImpl.getSequenceComparator()); @@ -456,7 +456,7 @@ public void onChange() { this.initialQueueBufferSize = this.cachedAddressSettings.getInitialQueueBufferSize() == null ? ActiveMQDefaultConfiguration.INITIAL_QUEUE_BUFFER_SIZE : this.cachedAddressSettings.getInitialQueueBufferSize(); - this.intermediateMessageReferences = new MpscUnboundedArrayQueue<>(initialQueueBufferSize); + this.intermediateMessageReferences = new MpscUnboundedVarHandleArrayQueue<>(initialQueueBufferSize); verifyDisabledConfiguration(); } diff --git a/tests/db-tests/pom.xml b/tests/db-tests/pom.xml index d91b7660df5..baec014edc1 100644 --- a/tests/db-tests/pom.xml +++ b/tests/db-tests/pom.xml @@ -129,7 +129,7 @@ org.jctools - jctools-core + jctools-core-jdk11 test diff --git a/tests/smoke-tests/pom.xml b/tests/smoke-tests/pom.xml index e9b5ffbd34b..dd8c4ad6359 100644 --- a/tests/smoke-tests/pom.xml +++ b/tests/smoke-tests/pom.xml @@ -98,7 +98,7 @@ org.jctools - jctools-core + jctools-core-jdk11 test