gemmellr commented on code in PR #4101:
URL: https://github.com/apache/activemq-artemis/pull/4101#discussion_r896886166
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java:
##########
@@ -626,6 +656,41 @@ public Page createPage(final int pageNumber) throws
Exception {
return page;
}
+ @Override
+ public final Page usePage(final long pageId) {
+ return usePage(pageId, true);
+ }
+
+ @Override
+ public Page usePage(final long pageId, final boolean create) {
+ synchronized (usedPages) {
+ try {
+ Page page = usedPages.get(pageId);
+ if (create && page == null) {
+ page = newPageObject(pageId);
+ if (page.getFile().exists()) {
+ page.getMessages();
+ injectPage(page);
+ }
Review Comment:
It just seems very weird to me that a Page returned from 'usePage()' can be
considered not part of 'usedPages', when 'usePage()' is the main thing adding
pages to the usedPages collection.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]