franz1981 commented on a change in pull request #3393:
URL: https://github.com/apache/activemq-artemis/pull/3393#discussion_r551786170
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
##########
@@ -468,16 +468,11 @@ protected void reloadLivePage(int pageId) throws
Exception {
Page page = createPage(pageId);
page.open();
- List<PagedMessage> messages = page.read(storageManager);
+ final List<PagedMessage> messages = page.read(storageManager);
- LivePageCache pageCache = new LivePageCacheImpl(pageId);
+ final PagedMessage[] initialMessages = messages.toArray(new
PagedMessage[messages.size()]);
- for (PagedMessage msg : messages) {
- pageCache.addLiveMessage(msg);
- // As we add back to the live page,
- // we have to discount one when we read the page
- msg.getMessage().usageDown();
- }
+ final LivePageCache pageCache = new LivePageCacheImpl(pageId,
initialMessages);
Review comment:
@clebertsuconic
the original `addLiveMessage` was calling `usageUp` right before
`usageDown`: it means that they can both be saved as the ref count will remain
the same, correct?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]