[
https://issues.apache.org/jira/browse/STORM-1129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15218655#comment-15218655
]
ASF GitHub Bot commented on STORM-1129:
---------------------------------------
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.
> Storm should use topology name instead of ids for url in storm UI.
> ------------------------------------------------------------------
>
> Key: STORM-1129
> URL: https://issues.apache.org/jira/browse/STORM-1129
> Project: Apache Storm
> Issue Type: Bug
> Components: storm-core
> Reporter: Priyank Shah
> Assignee: Priyank Shah
>
> Currently, in storm UI details about a topology can be viewed at a URL which
> has a topology id as a query parameter. When a topology is updated and
> redeployed a new id is assigned by storm and existing URL(and any bookmarks
> relying on it) for the topology do not work since the id has changed. We
> should change it so that topology name is used instead of id.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)