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

    https://github.com/apache/storm/pull/921#discussion_r47696530
  
    --- Diff: storm-core/src/jvm/backtype/storm/scheduler/Cluster.java ---
    @@ -430,12 +457,44 @@ public SupervisorDetails getSupervisorById(String 
nodeId) {
         }
     
         /**
    +     * set assignments for cluster
    +     */
    +    public void setAssignments(Map<String, SchedulerAssignment> 
newAssignments) {
    +        this.assignments = new HashMap<String, SchedulerAssignmentImpl>();
    +        for (Map.Entry<String, SchedulerAssignment> entry : 
newAssignments.entrySet()) {
    +            this.assignments.put(entry.getKey(), new 
SchedulerAssignmentImpl(entry.getValue().getTopologyId(), 
entry.getValue().getExecutorToSlot()));
    --- End diff --
    
    Why not add a copyOf method to SchedulerAssignmentImpl? 
    `SchedulerAssignmentImpl.copyOf(entry.getValue())`
    
    That should sort of clarify any confusion that you're just making 
`assignments` into a copy of `newAssignments`.


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