[ 
https://issues.apache.org/jira/browse/ARTEMIS-2676?focusedWorklogId=414526&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-414526
 ]

ASF GitHub Bot logged work on ARTEMIS-2676:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Apr/20 08:12
            Start Date: 02/Apr/20 08:12
    Worklog Time Spent: 10m 
      Work Description: franz1981 commented on pull request #3044: ARTEMIS-2676 
PageCursorProviderImpl::cleanup can save decoding pages without large messages
URL: https://github.com/apache/activemq-artemis/pull/3044#discussion_r401919551
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/Page.java
 ##########
 @@ -376,29 +395,38 @@ private static ChannelBufferWrapper wrapWhole(ByteBuffer 
fileBuffer) {
                      final int endPosition = fileBuffer.position() + 
encodedSize;
                      //this check must be performed upfront decoding
                      if (fileBuffer.remaining() >= (encodedSize + 1) && 
fileBuffer.get(endPosition) == Page.END_BYTE) {
-                        final PagedMessageImpl msg = new 
PagedMessageImpl(encodedSize, storageManager);
                         fileBufferWrapper.setIndex(fileBuffer.position(), 
endPosition);
-                        msg.decode(fileBufferWrapper);
-                        fileBuffer.position(endPosition + 1);
-                        assert fileBuffer.get(endPosition) == Page.END_BYTE : 
"decoding cannot change end byte";
-                        msg.initMessage(storage);
-                        assert msg.getMessage() instanceof LargeServerMessage 
&& ((LargeServerMessage)msg.getMessage()).getStorageManager() != null || 
!(msg.getMessage() instanceof LargeServerMessage);
-                        if (logger.isTraceEnabled()) {
-                           logger.tracef("Reading message %s on pageId=%d for 
address=%s", msg, pageId, storeName);
+                        final boolean skipMessage;
+                        if (onlyLargeMessages) {
+                           skipMessage = 
!PagedMessageImpl.isLargeMessage(fileBufferWrapper);
+                        } else {
+                           skipMessage = false;
                         }
-                        messages.add(msg);
+                        if (!skipMessage) {
+                           final PagedMessageImpl msg = new 
PagedMessageImpl(encodedSize, storageManager);
+                           msg.decode(fileBufferWrapper);
+                           assert fileBuffer.get(endPosition) == Page.END_BYTE 
: "decoding cannot change end byte";
+                           msg.initMessage(storage);
 
 Review comment:
   @clebertsuconic I see that sometime we use storage and sometime the member 
storage manager stored on the Page...any idea which one would be the most 
correct to use?
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 414526)
    Time Spent: 5h  (was: 4h 50m)

> PageCursorProviderImpl::cleanup can save decoding pages without large messages
> ------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-2676
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2676
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 2.11.0
>            Reporter: Francesco Nigro
>            Priority: Major
>          Time Spent: 5h
>  Remaining Estimate: 0h
>
> PageCurosrProviderImpl::cleanup is calling 
> PageCurosrProviderImpl::finishCleanup that's fully reading pages (when not 
> present in the PageCache), just to trigger large messages delete.
> The decoding phase could be skipped and possibly the page read as well.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to