File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
src/jvm/backtype/storm/scheduler Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -84,8 +84,7 @@ public boolean needsScheduling(TopologyDetails topology) {
84
84
* @return
85
85
*/
86
86
public Map <ExecutorDetails , String > getNeedsSchedulingExecutorToComponents (TopologyDetails topology ) {
87
- Collection <ExecutorDetails > allExecutors = new ArrayList <ExecutorDetails >();
88
- allExecutors .addAll (topology .getExecutors ());
87
+ Collection <ExecutorDetails > allExecutors = new HashSet (topology .getExecutors ());
89
88
90
89
SchedulerAssignment assignment = this .assignments .get (topology .getId ());
91
90
if (assignment != null ) {
@@ -175,13 +174,12 @@ public List<WorkerSlot> getAvailableSlots(SupervisorDetails supervisor) {
175
174
/**
176
175
* get the unassigned executors of the topology.
177
176
*/
178
- public List <ExecutorDetails > getUnassignedExecutors (TopologyDetails topology ) {
177
+ public Collection <ExecutorDetails > getUnassignedExecutors (TopologyDetails topology ) {
179
178
if (topology == null ) {
180
179
return new ArrayList <ExecutorDetails >(0 );
181
180
}
182
181
183
- List <ExecutorDetails > ret = new ArrayList <ExecutorDetails >();
184
- ret .addAll (topology .getExecutors ());
182
+ Collection <ExecutorDetails > ret = new HashSet (topology .getExecutors ());
185
183
186
184
SchedulerAssignment assignment = this .getAssignmentById (topology .getId ());
187
185
if (assignment != null ) {
You can’t perform that action at this time.
0 commit comments