You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by sr...@apache.org on 2019/07/29 15:42:41 UTC

[storm] branch master updated: STORM-3476 don't query remote files on cleanup if target size is acceptable

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

srdo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/storm.git


The following commit(s) were added to refs/heads/master by this push:
     new 1008feb  STORM-3476 don't query remote files on cleanup if target size is acceptable
     new 94e5ad1  Merge pull request #3093 from agresch/agresch_storm_3476
1008feb is described below

commit 1008feba371dd33232070603a54f8b3f4ed49ae7
Author: Aaron Gresch <ag...@yahoo-inc.com>
AuthorDate: Thu Jul 25 16:29:04 2019 -0500

    STORM-3476 don't query remote files on cleanup if target size is acceptable
---
 .../org/apache/storm/localizer/LocalizedResourceRetentionSet.java     | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/storm-server/src/main/java/org/apache/storm/localizer/LocalizedResourceRetentionSet.java b/storm-server/src/main/java/org/apache/storm/localizer/LocalizedResourceRetentionSet.java
index f96b481..25d6f4d 100644
--- a/storm-server/src/main/java/org/apache/storm/localizer/LocalizedResourceRetentionSet.java
+++ b/storm-server/src/main/java/org/apache/storm/localizer/LocalizedResourceRetentionSet.java
@@ -81,6 +81,10 @@ public class LocalizedResourceRetentionSet {
     public void cleanup(ClientBlobStore store) {
         LOG.debug("cleanup target size: {} current size is: {}", targetSize, currentSize);
         long bytesOver = currentSize - targetSize;
+        if (bytesOver <= 0) { // no need to query remote files
+            return;
+        }
+
         //First delete everything that no longer exists...
         for (Iterator<Map.Entry<LocallyCachedBlob, Map<String, ? extends LocallyCachedBlob>>> i = noReferences.entrySet().iterator();
              i.hasNext(); ) {