clebertsuconic commented on a change in pull request #3983:
URL: https://github.com/apache/activemq-artemis/pull/3983#discussion_r829323741
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
##########
@@ -189,13 +198,45 @@ public PagingStoreImpl(final SimpleString address,
this.usingGlobalMaxSize = pagingManager.isUsingGlobalSize();
}
+ private static SizeAwareMetric getGlobalMetric(PagingManager manager) {
+ if (manager instanceof PagingManagerImpl) {
+ return ((PagingManagerImpl) manager).getSizeAwareMetric();
+ } else {
+ // for unit / mock tests
+ SizeAwareMetric metric = new SizeAwareMetric(-1, -1, -1, -1, -1, 1,
1, 0, 0);
+ metric.addOnSizeCallback(manager::addSize, false);
+ metric.addOnSizeCallback((l) -> manager.addSize(l, true), true);
+ return metric;
+ }
+ }
Review comment:
the other bits is just returning a proxy to the pagingManager API.
anyway I'm adding SizeAwareMetric to the public api with a default
implementation to the proxy version now.
--
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]