You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Christopher L. Shannon (JIRA)" <ji...@apache.org> on 2015/06/02 22:08:50 UTC

[jira] [Comment Edited] (AMQ-5748) Add the ability to get Message Size from a Message Store

    [ https://issues.apache.org/jira/browse/AMQ-5748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14569665#comment-14569665 ] 

Christopher L. Shannon edited comment on AMQ-5748 at 6/2/15 8:08 PM:
---------------------------------------------------------------------

[~gtully] and [~tabish121],

I have updated my pull request to add a new statistics object, {{MessageStoreStatistics}}. This bean is now used to track both the message count and message size of the store (and can be used for future stuff too).  I updated {{getMessageCount}} to now be non-blocking as it delegates to the statistics bean instead.  Can one of you take a look and let me know what you think?  I believe the counters should be updated in the proper locations (and recovered properly on restart) but I could have missed something.  Right now the bean is only updated in Kaha and the Memory message store. 

Would it be possible to get the final version of this patch into 5.12? 

I also noticed that a unit test was failing, the testRecoveryAfterCorruptionCheckSumExistingIndex method in JournalCorruptionEofIndexRecoverTest.  I looked at for a little while but I haven't figured out what is wrong with it yet.  I'll keep looking at it but if you notice anything obvious before I figure it out let me know.

Thanks,
Chris


was (Author: christopher.l.shannon):
[~gtully] and [~tabish121],

I have updated my pull request to add a new statistics object, {MessageStoreStatistics}.  This bean is now used to track both the message count and message size of the store (and can be used for future stuff too).  I updated {getMessageCount}} to now be non-blocking as it delegates to the statistics bean instead.  Can one of you take a look and let me know what you think?  I believe the counters should be updated in the proper locations (and recovered properly on restart) but I could have missed something.  Right now the bean is only updated in Kaha and the Memory message store. 

Would it be possible to get the final version of this patch into 5.12? 

I also noticed that a unit test was failing, the testRecoveryAfterCorruptionCheckSumExistingIndex method in JournalCorruptionEofIndexRecoverTest.  I looked at for a little while but I haven't figured out what is wrong with it yet.  I'll keep looking at it but if you notice anything obvious before I figure it out let me know.

Thanks,
Chris

> Add the ability to get Message Size from a Message Store
> --------------------------------------------------------
>
>                 Key: AMQ-5748
>                 URL: https://issues.apache.org/jira/browse/AMQ-5748
>             Project: ActiveMQ
>          Issue Type: New Feature
>          Components: Broker
>    Affects Versions: 5.11.1
>            Reporter: Christopher L. Shannon
>            Priority: Minor
>
> Currently, the {{MessageStore}} interface supports getting a count for messages ready to deliver using the {{getMessageCount}} method.  It would also be very useful to be able to retrieve the message sizes for those counts as well for keeping track of metrics.
> I've created a pull request to address this that adds a {{getMessageSize}} method that focuses specifically on KahaDB and the Memory store.  The KahaDB store uses the same strategy as the existing {{getMessageCount}} method, which is to iterate over the index and total up the size of the messages.  There are unit tests to show the size calculation and a unit test that shows a store based on version 5 working with the new version (the index is rebuilt)
> One extra issue is that the size was not being serialized to the index (it was not included in the marshaller) so that required making a slight change and adding a new marshaller for {{Location}} to store the size in the location index of the store.  Without this change, the size computation would not work when the broker was restarted since the size was not serialized.
> Note that I wasn't sure the best way to handle the new marshaller and version compatibilities so I incremented the KahaDB version from 5 to 6. If an old version of the index is loaded, the index should be detected as corrupted and be rebuilt with the new format.  If there is a better way to handle this upgrade let me know and the patch can certainly be updated.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)