You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by tm...@apache.org on 2019/04/18 11:49:43 UTC

[sling-org-apache-sling-distribution-journal] branch master updated: SLING-8362 - Log cleared offsets from package status watcher

This is an automated email from the ASF dual-hosted git repository.

tmaret pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git


The following commit(s) were added to refs/heads/master by this push:
     new 2df27d4  SLING-8362 - Log cleared offsets from package status watcher
2df27d4 is described below

commit 2df27d499de70064731b967e5e565b60afb6e882
Author: tmaret <tm...@adobe.com>
AuthorDate: Thu Apr 18 13:49:33 2019 +0200

    SLING-8362 - Log cleared offsets from package status watcher
---
 .../distribution/journal/impl/subscriber/PackageStatusWatcher.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/distribution/journal/impl/subscriber/PackageStatusWatcher.java b/src/main/java/org/apache/sling/distribution/journal/impl/subscriber/PackageStatusWatcher.java
index 47375db..22a2824 100644
--- a/src/main/java/org/apache/sling/distribution/journal/impl/subscriber/PackageStatusWatcher.java
+++ b/src/main/java/org/apache/sling/distribution/journal/impl/subscriber/PackageStatusWatcher.java
@@ -83,7 +83,11 @@ public class PackageStatusWatcher implements Closeable {
      * @param pkgOffset
      */
     public void clear(long pkgOffset) {
-        cache.headMap(pkgOffset, false).clear();
+        NavigableMap<Long, FullMessage<PackageStatusMessage>> removed = cache.headMap(pkgOffset, false);
+        if (! removed.isEmpty()) {
+            LOG.info("Remove package offsets {} from status cache", removed.keySet());
+        }
+        removed.clear();
     }
 
     @Override