diff --git a/artemis-features/src/main/resources/features.xml b/artemis-features/src/main/resources/features.xml index c00193f8e640..1a26dc4062f4 100644 --- a/artemis-features/src/main/resources/features.xml +++ b/artemis-features/src/main/resources/features.xml @@ -74,6 +74,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 8488a5cce36b..d9347238b677 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 e2c2f6971260..f839b24b1201 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 40dabfc2350c..2ef3fc15e175 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 003d220496b2..ddf6b1f0c32b 100644 --- a/artemis-pom/pom.xml +++ b/artemis-pom/pom.xml @@ -422,6 +422,12 @@ ${jctools.version} + + org.jctools + jctools-core-jdk11 + ${jctools.version} + + org.hdrhistogram HdrHistogram diff --git a/artemis-server/pom.xml b/artemis-server/pom.xml index d72dd54599be..87b522dbb21f 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 9b23fd7e4855..ac01ed23e434 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 @@ -124,7 +124,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; @@ -202,7 +202,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()); @@ -457,7 +457,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 bae2e8c0943d..30ff48f96ca1 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 4b7e72e2eafe..4eb47ffdf2c4 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