Commit 120aa34
committed
AMQ-9824 - Cleanup code in KahaDB classes
This cleanups the MessageDatabase and KahaDBStore classes.
This commit includes 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
(cherry picked from commit b7184b4)1 parent 4f3bafb commit 120aa34
File tree
7 files changed
+685
-929
lines changed- activemq-kahadb-store/src
- main/java/org/apache/activemq/store/kahadb
- test/java/org/apache/activemq/store/kahadb
- activemq-unit-tests/src/test/java/org/apache/activemq
- bugs
- store/kahadb
7 files changed
+685
-929
lines changedLines changed: 364 additions & 461 deletions
Large diffs are not rendered by default.
Lines changed: 288 additions & 429 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | | - | |
| 430 | + | |
| 431 | + | |
432 | 432 | | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
450 | 446 | | |
| 447 | + | |
451 | 448 | | |
452 | 449 | | |
453 | 450 | | |
454 | | - | |
| 451 | + | |
455 | 452 | | |
456 | 453 | | |
457 | 454 | | |
| |||
Lines changed: 10 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
179 | 176 | | |
180 | 177 | | |
181 | 178 | | |
182 | | - | |
| 179 | + | |
183 | 180 | | |
184 | 181 | | |
185 | 182 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBMessageStoreSizeTest.java
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
0 commit comments