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

    https://github.com/apache/storm/pull/2433#discussion_r173213324
  
    --- Diff: 
storm-client/src/jvm/org/apache/storm/cluster/IStormClusterState.java ---
    @@ -233,23 +249,11 @@
          * @return the id of the topology or null if it is not alive.
          */
         default Optional<String> getTopoId(final String topologyName) {
    -        String ret = null;
    -        for (String topoId: activeStorms()) {
    -            StormBase base = stormBase(topoId, null);
    -            if (base != null && topologyName.equals(base.get_name())) {
    -                ret = topoId;
    -                break;
    -            }
    -        }
    -        return Optional.ofNullable(ret);
    +        return Optional.ofNullable(stormId(topologyName));
         }
         
         default Map<String, Assignment> topologyAssignments() {
    -        Map<String, Assignment> ret = new HashMap<>();
    -        for (String topoId: assignments(null)) {
    -            ret.put(topoId, assignmentInfo(topoId, null));
    -        }
    -        return ret;
    +        return assignmentsInfo();
    --- End diff --
    
    Why do we need 2 methods that do the exact same thing, but are called 
different things?  Please refactor them into one.


---

Reply via email to