This is an automated email from the ASF dual-hosted git repository. clebertsuconic pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
commit 4bcad4bf478e21803dac6b5cf2f23ff5372f99f7 Author: Clebert Suconic <[email protected]> AuthorDate: Mon Jan 14 11:38:46 2019 -0500 ARTEMIS-2224 Javadoc changes after the paging lock changes --- .../java/org/apache/activemq/artemis/core/paging/PagingStore.java | 5 +++++ .../apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingStore.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingStore.java index 5a290ba..a49e58d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingStore.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingStore.java @@ -69,6 +69,11 @@ public interface PagingStore extends ActiveMQComponent, RefCountMessageListener void applySetting(AddressSettings addressSettings); + /** This method will look if the current state of paging is not paging, + * without using a lock. + * For cases where you need absolutely atomic results, check it directly on the internal variables while requiring a readLock. + * + * It's ok to look for this with an estimate on starting a task or not, but you will need to recheck on actual paging operations. */ boolean isPaging(); /** diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java index 2033030..213ff2b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java @@ -493,12 +493,7 @@ public class PagingStoreImpl implements PagingStore { lock.readLock().lock(); try { - // I'm not calling isPaging() here because - // isPaging will perform extra steps. - // at this context it doesn't really matter what policy we are using - // since this method is only called when paging. - // Besides that isPaging() will perform lock.readLock() again which is not needed here - // for that reason the attribute is used directly here. + // I'm not calling isPaging() here because i need to be atomic and hold a lock. if (paging) { return false; }
