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

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

                Author: ASF GitHub Bot
            Created on: 13/Jun/22 19:24
            Start Date: 13/Jun/22 19:24
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on code in PR #4101:
URL: https://github.com/apache/activemq-artemis/pull/4101#discussion_r896059505


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PagedReferenceImpl.java:
##########
@@ -50,14 +47,24 @@ public class PagedReferenceImpl extends 
LinkedListImpl.Node<PagedReferenceImpl>
 
    private int messageEstimate = -1;
 
+   volatile PagePosition position;
+
+   @Override
+   public PagePosition getPosition() {
+      if (position == null) {
+         position = getPagedMessage().newPositionObject();
+      }
+      return position;

Review Comment:
   There is no need to be volatile. This is just caching a new PagePosition, 
which will be immutable.
   





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

    Worklog Id:     (was: 780916)
    Time Spent: 7h 20m  (was: 7h 10m)

> Add Option to read messages into paging based on sizing and eliminate caching
> -----------------------------------------------------------------------------
>
>                 Key: ARTEMIS-3850
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3850
>             Project: ActiveMQ Artemis
>          Issue Type: New Feature
>    Affects Versions: 2.22.0
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.24.0
>
>          Time Spent: 7h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to