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

    https://github.com/apache/storm/pull/1277#discussion_r57948138
  
    --- Diff: storm-core/src/clj/org/apache/storm/ui/core.clj ---
    @@ -466,6 +466,21 @@
            "assignedCpu" (.get_assigned_cpu t)})
         "schedulerDisplayResource" (*STORM-CONF* 
Config/SCHEDULER_DISPLAY_RESOURCE)}))
     
    +(defn get-topology-id [topology-name-or-id]
    +  (let [summary ((all-topologies-summary) "topologies")
    +        filter-fun-name (fn[topo-summary] (= (topo-summary "name") 
topology-name-or-id))
    +        filter-fun-id (fn[topo-summary] (= (topo-summary "id") 
topology-name-or-id))
    +        matching-topologies-by-name (filter filter-fun-name summary)
    +        matching-topologies-by-id (filter filter-fun-id summary)
    +        matching-topologies
    +        (cond
    +          (not-empty matching-topologies-by-name) 
matching-topologies-by-name
    +          (not-empty matching-topologies-by-id) matching-topologies-by-id
    +          :else nil)
    +        _ (when (empty? matching-topologies) (throw (NotAliveException. 
(str topology-name-or-id " is not alive"))))
    +        id ((first matching-topologies) "id")]
    +    id))
    --- End diff --
    
    We should probably prioritize matching ids here instead of matching names. 
As it is now, If I give my topology a name that matches another topology's id, 
the topology whose id I stole will become inaccessible. Since we're 
prioritizing names, it will match that topology's id to my topology's name, and 
display my topology instead.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to