cshannon commented on code in PR #2231:
URL: https://github.com/apache/activemq/pull/2231#discussion_r3617327113
##########
activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java:
##########
@@ -3893,8 +3915,12 @@ class MessageOrderIterator implements
Iterator<Entry<Long, MessageKeys>>{
final Iterator<Entry<Long, MessageKeys>>highIterator;
final Iterator<Entry<Long, MessageKeys>>defaultIterator;
final Iterator<Entry<Long, MessageKeys>>lowIterator;
+ // when false, next() leaves the shared
lastDefaultKey/lastHighKey/lastLowKey
+ // bookmarks untouched so this iteration cannot affect the
destination cursor
+ final boolean trackLastKeys;
- MessageOrderIterator(Transaction tx, MessageOrderCursor m,
MessageOrderIndex messageOrderIndex) throws IOException {
+ MessageOrderIterator(Transaction tx, MessageOrderCursor m,
MessageOrderIndex messageOrderIndex, boolean trackLastKeys) throws IOException {
Review Comment:
Instead of using a single MessageOrderIterator with lots of args I am
wondering if it makes sense to just have two impls.
We could rename MessageOrderIterator to IsolatedMessageOrderIterator that
does no tracking (uses a new MessageOrderIndex() and doesn't track keys), and
then extend that class with MessageOrderIterator that tracks keys and uses the
shared MessageOrderCursor.
This is just an idea I had, I'm not sure if it would make it better or worse
without trying it compared to constructor orgs and a single impl
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact