[
https://issues.apache.org/jira/browse/AMQ-9824?focusedWorklogId=997119&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-997119
]
ASF GitHub Bot logged work on AMQ-9824:
---------------------------------------
Author: ASF GitHub Bot
Created on: 19/Dec/25 13:36
Start Date: 19/Dec/25 13:36
Worklog Time Spent: 10m
Work Description: cshannon commented on code in PR #1567:
URL: https://github.com/apache/activemq/pull/1567#discussion_r2635125549
##########
activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/KahaDBStore.java:
##########
@@ -109,8 +106,8 @@ public class KahaDBStore extends MessageDatabase implements
PersistenceAdapter,
protected ExecutorService queueExecutor;
protected ExecutorService topicExecutor;
- protected final List<Map<AsyncJobKey, StoreTask>> asyncQueueMaps = new
LinkedList<>();
- protected final List<Map<AsyncJobKey, StoreTask>> asyncTopicMaps = new
LinkedList<>();
+ final List<Map<AsyncJobKey, StoreTask>> asyncQueueMaps = new
LinkedList<>();
Review Comment:
All the scope changes were done because they were previously incorrect and
my IDE flagged it. In this case,
[AsyncJobKey](https://github.com/apache/activemq/blob/ef789aad2659334777657b779a6e00fe025937f0/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/KahaDBStore.java#L1674)
is package scope and not protected.
It would is impossible for someone to extend the class and use AsyncJobKey
anyways, etc so changing the scope didn't cause problems. The two choices were
to narrow that line or to expand the scope and my preference is always to
narrow vs expand unless we need to. Generally speaking with KahaDB most things
should likely just be package scope anyways.
Issue Time Tracking
-------------------
Worklog Id: (was: 997119)
Time Spent: 1h (was: 50m)
> Cleanup KahaDBStore and MessageDatabase classes
> -----------------------------------------------
>
> Key: AMQ-9824
> URL: https://issues.apache.org/jira/browse/AMQ-9824
> Project: ActiveMQ
> Issue Type: Task
> Components: KahaDB
> Reporter: Christopher L. Shannon
> Assignee: Christopher L. Shannon
> Priority: Major
> Fix For: 6.3.0
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> While looking at AMQ-9823 I noticed just how much of a mess a lot of the code
> is in KahaDB. I decided to go through and clean up some of the issues in the
> code and also modernize it a bit (ie use lambdas in some spots). There is
> still more to do but this will be a good start. Note that I only tackled the
> KahaDBStore and MessageDatabase classes as there were already a lot of
> changes and the PR is big enough. Other classes like PageFile or future work
> can be done in a follow on PR.
> This task will include the following:
> * Fixes the scope of several methods and types. For example, there were many
> cases where protected methods were referencing types that were package scope.
> * Simplified the code by replacing anonymous methods with lambdas
> * removed unused methods and parameters
> * removed unnecessary casts
> * cleaned up the use of generics where types could be inferred
> * Replaced the ReentrantReadWriteLock that was used for indexLock with
> ReentrantLock becuase only the write lock was ever being used (the page file
> doesn't support concurrent reads right now). This should provide a small
> performance/memory improvement and simplifies the code a bit.
> * removed unnecessary null initializations
> * cleaned up logging to remove string concatenation and instead use parameters
> * removed method overrides that are the same as the parent or just call the
> super method
> * removed unused checked exceptions from method's throws
> * marked inner classes as static when possible
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact