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

    https://github.com/apache/storm/pull/2686#discussion_r191043807
  
    --- 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.
    +     *
    +     * @param store  blobstore to search
    +     * @param conf  the nimbus conf
    +     * @return a set of
    +     */
    +    static Set<String> getIdleTopologyIds(BlobStore store, Map<String, 
Object> conf) {
    --- End diff --
    
    I think the name here is confusing. Isn't this method returning all 
topology ids that have existed in the blob store for longer than 
NIMBUS_TOPOLOGY_BLOBSTORE_DELETION_DELAY_MSEC?


---

Reply via email to