tmaret commented on code in PR #63:
URL:
https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/63#discussion_r1135487488
##########
src/main/java/org/apache/sling/distribution/journal/bookkeeper/BookKeeper.java:
##########
@@ -113,16 +117,33 @@ public BookKeeper(
this.config = config;
String nameRetries = DistributionMetricsService.SUB_COMPONENT +
".current_retries;sub_name=" + config.getSubAgentName();
this.retriesGauge =
distributionMetricsService.createGauge(nameRetries, "Retries of current
package", packageRetries::getSum);
+
+ this.resolversOpenedGauge = distributionMetricsService
+ .createGauge(DistributionMetricsService.SUB_COMPONENT +
".openedResolvers;sub_name=" + config.getSubAgentName(),
+ "number of opened ResourceResolvers for this bookkeeper",
resolverOpenCounter::get);
this.resolverFactory = resolverFactory;
this.distributionMetricsService = distributionMetricsService;
// Error queues are enabled when the number
// of retry attempts is limited ; disabled otherwise
this.errorQueueEnabled = (config.getMaxRetries() >= 0);
- this.statusStore = new LocalStore(resolverFactory, STORE_TYPE_STATUS,
config.getSubAgentName());
- this.processedOffsets = new LocalStore(resolverFactory,
STORE_TYPE_PACKAGE, config.getSubAgentName());
+ this.statusStore = new LocalStore(bookKeeperResolver,
STORE_TYPE_STATUS, config.getSubAgentName());
Review Comment:
BookKeeper is long lived, but the resources resolvers it builds inside the
LocalStore are short lived and kept private. I think the current implementation
is good and simple.
--
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]