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

    https://github.com/apache/storm/pull/921#discussion_r47681877
  
    --- Diff: storm-core/src/jvm/backtype/storm/scheduler/Cluster.java ---
    @@ -90,6 +92,21 @@ public Cluster(INimbus nimbus, Map<String, 
SupervisorDetails> supervisors, Map<S
             }
             this.conf = storm_conf;
         }
    +
    +    /**
    +     * Get a copy of this cluster object
    +     */
    +    public Cluster getCopy() {
    +        HashMap<String, SchedulerAssignmentImpl> newAssignments = new 
HashMap<String, SchedulerAssignmentImpl>();
    +        for (Map.Entry<String, SchedulerAssignmentImpl> entry : 
this.assignments.entrySet()) {
    +            newAssignments.put(entry.getKey(), new 
SchedulerAssignmentImpl(entry.getValue().getTopologyId(), 
entry.getValue().getExecutorToSlot()));
    +        }
    +        Map newConf = new HashMap<String, Object>();
    +        newConf.putAll(this.conf);
    --- End diff --
    
    Why do you use the "this" keyword? It is customary to use this in the 
constructor of an object. But using it everywhere else in the class methods 
just adds to the code clutter. I'd suggest removing this.xyz from everywhere 
else in the pull request.


---
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