Github user srdo commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2686#discussion_r191043819
  
    --- Diff: 
storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java ---
    @@ -828,12 +831,54 @@ private static boolean 
isTopologyActive(IStormClusterState state, String topoNam
             }
         }
     
    +    private static void rotateTopologyCleanupMap(long deletionDelay) {
    +        if (Time.currentTimeMillis() - topologyCleanupRotationTime > 
deletionDelay) {
    +            topologyCleanupDetected.rotate();
    +            topologyCleanupRotationTime = Time.currentTimeMillis();
    +        }
    +    }
    +
    +    private static long getTopologyCleanupDetectedTime(String topologyId) {
    +        Long firstDetectedForDeletion = 
topologyCleanupDetected.get(topologyId);
    +        if (firstDetectedForDeletion == null) {
    +            firstDetectedForDeletion = Time.currentTimeMillis();
    +            topologyCleanupDetected.put(topologyId, 
firstDetectedForDeletion);
    +        }
    +        return firstDetectedForDeletion;
    +    }
    +
    +    /**
    +     * Finds blobstore entries with no matching topology.  Waits 
NIMBUS_TOPOLOGY_BLOBSTORE_DELETION_DELAY_MSEC
    +     * before reporting the topologies found.  The delay is to prevent a 
race condition between when a blobstore
    +     * is created and when the topology is submitted.  It is possible the 
Nimbus cleanup timer task will find
    +     * entries to delete between these two events.
    --- End diff --
    
    The javadoc should mention that this method updates the rotating map I 
think.


---

Reply via email to