Skip to content

Commit

Permalink
cleanup data structures used in Cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Marz committed Jul 25, 2012
1 parent 0c4cb5e commit a10f8bb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/jvm/backtype/storm/scheduler/Cluster.java
Expand Up @@ -84,8 +84,7 @@ public boolean needsScheduling(TopologyDetails topology) {
* @return
*/
public Map<ExecutorDetails, String> getNeedsSchedulingExecutorToComponents(TopologyDetails topology) {
Collection<ExecutorDetails> allExecutors = new ArrayList<ExecutorDetails>();
allExecutors.addAll(topology.getExecutors());
Collection<ExecutorDetails> allExecutors = new HashSet(topology.getExecutors());

SchedulerAssignment assignment = this.assignments.get(topology.getId());
if (assignment != null) {
Expand Down Expand Up @@ -175,13 +174,12 @@ public List<WorkerSlot> getAvailableSlots(SupervisorDetails supervisor) {
/**
* get the unassigned executors of the topology.
*/
public List<ExecutorDetails> getUnassignedExecutors(TopologyDetails topology) {
public Collection<ExecutorDetails> getUnassignedExecutors(TopologyDetails topology) {
if (topology == null) {
return new ArrayList<ExecutorDetails>(0);
}

List<ExecutorDetails> ret = new ArrayList<ExecutorDetails>();
ret.addAll(topology.getExecutors());
Collection<ExecutorDetails> ret = new HashSet(topology.getExecutors());

SchedulerAssignment assignment = this.getAssignmentById(topology.getId());
if (assignment != null) {
Expand Down

0 comments on commit a10f8bb

Please sign in to comment.