You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by GitBox <gi...@apache.org> on 2022/02/22 12:57:10 UTC

[GitHub] [sling-org-apache-sling-distribution-journal] tmaret commented on a change in pull request #100: SLING-11156 - Add seeding message if RangePoller times out

tmaret commented on a change in pull request #100:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/100#discussion_r811916214



##########
File path: src/main/java/org/apache/sling/distribution/journal/impl/publisher/RangePoller.java
##########
@@ -51,16 +54,24 @@
     private final CountDownLatch fetched = new CountDownLatch(1);
 
     private final List<FullMessage<PackageMessage>> messages;
-    
+
+    private final QueueCacheSeeder seeder;
+
+    private final int seedDelaySeconds;
+
     public RangePoller(MessagingProvider messagingProvider,
                           String packageTopic,
                           long minOffset,
-                          long maxOffsetExclusive) {
+                          long maxOffsetExclusive,
+                          int seedDelaySeconds) {
         this.maxOffset = maxOffsetExclusive;
         this.minOffset = minOffset;
+        this.seedDelaySeconds = seedDelaySeconds;
         this.messages = new ArrayList<>();
         String assign = messagingProvider.assignTo(minOffset);
         LOG.info("Fetching offsets [{},{}[", minOffset, maxOffsetExclusive);
+        MessageSender<PackageMessage> sender = messagingProvider.createSender(packageTopic);

Review comment:
       Minor improvement, the `sender` and `seeder` instantiation could be done only after the `seedDelaySeconds` since in most cases they will not be needed.




-- 
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