You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by "tmaret (via GitHub)" <gi...@apache.org> on 2023/03/14 12:46:11 UTC

[GitHub] [sling-org-apache-sling-distribution-journal] tmaret commented on a diff in pull request #63: SLING-10107 [Refactoring] improve resourceresolver handling

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: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org