You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/10/14 19:32:57 UTC
[GitHub] [activemq-artemis] gtully commented on a change in pull request #3282: ARTEMIS-2859 - track owning page store as a transient message attribute to ensure correct usage tracking
gtully commented on a change in pull request #3282:
URL: https://github.com/apache/activemq-artemis/pull/3282#discussion_r504922645
##########
File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
##########
@@ -970,36 +970,37 @@ public long getID() {
@Override
public int durableUp(Message message) {
- int count = message.durableUp();
- if (pagingStore != null) {
- pagingStore.durableUp(message, count);
- }
- return count;
+ return message.durableUp();
}
@Override
public int durableDown(Message message) {
- int count = message.durableDown();
- if (pagingStore != null) {
- pagingStore.durableDown(message, count);
- }
- return count;
+ return message.durableDown();
}
@Override
- public void refUp(Message message) {
- int count = message.refUp();
+ public void refUp(MessageReference messageReference) {
+ int count = messageReference.getMessage().refUp();
+ if (count == 1) {
+ if (messageReference.getOwner() != null) {
+ messageReference.getOwner().addSize(messageReference.getMessageMemoryEstimate());
+ }
+ }
if (pagingStore != null) {
- pagingStore.refUp(message, count);
+ pagingStore.refUp(messageReference.getMessage(), count);
}
-
}
@Override
- public void refDown(Message message) {
- int count = message.refDown();
+ public void refDown(MessageReference messageReference) {
+ int count = messageReference.getMessage().refDown();
+ if (count == 0) {
+ if (messageReference.getOwner() != null) {
+ messageReference.getOwner().addSize(-messageReference.getMessageMemoryEstimate());
Review comment:
it seems only notification/management addresses have a null page store, however the reference count need to be independent of any particular queue having a page store
----------------------------------------------------------------
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:
users@infra.apache.org