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

    https://github.com/apache/storm/pull/921#discussion_r47691122
  
    --- 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 --
    
    a lot of other existing function in the cluster use "this" to as well.  I 
personally like to use "this" so that I can easily tell that a variable is 
member variable and a function is a method of the class


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