Minor
Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/3c79096f Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/3c79096f Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/3c79096f Branch: refs/heads/master Commit: 3c79096f6295559ee649e88ff3569a6fae0b5723 Parents: 91f8a45 Author: zhuol <[email protected]> Authored: Fri Mar 25 16:38:53 2016 -0500 Committer: zhuol <[email protected]> Committed: Fri Mar 25 16:38:53 2016 -0500 ---------------------------------------------------------------------- .../scheduler/resource/TestResourceAwareScheduler.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/storm/blob/3c79096f/storm-core/test/jvm/org/apache/storm/scheduler/resource/TestResourceAwareScheduler.java ---------------------------------------------------------------------- diff --git a/storm-core/test/jvm/org/apache/storm/scheduler/resource/TestResourceAwareScheduler.java b/storm-core/test/jvm/org/apache/storm/scheduler/resource/TestResourceAwareScheduler.java index 720f2d6..d81c176 100644 --- a/storm-core/test/jvm/org/apache/storm/scheduler/resource/TestResourceAwareScheduler.java +++ b/storm-core/test/jvm/org/apache/storm/scheduler/resource/TestResourceAwareScheduler.java @@ -432,12 +432,7 @@ public class TestResourceAwareScheduler { // pick a worker to mock as failed WorkerSlot failedWorker = new ArrayList<WorkerSlot>(assignment.getSlots()).get(0); Map<ExecutorDetails, WorkerSlot> executorToSlot = assignment.getExecutorToSlot(); - List<ExecutorDetails> failedExecutors = new ArrayList<>(); - for (Map.Entry<ExecutorDetails, WorkerSlot> entry : executorToSlot.entrySet()) { - if (entry.getValue().equals(failedWorker)) { - failedExecutors.add(entry.getKey()); - } - } + Collection<ExecutorDetails> failedExecutors = assignment.getSlotToExecutors().get(failedWorker); for (ExecutorDetails executor : failedExecutors) { executorToSlot.remove(executor); // remove executor details assigned to the failed worker } @@ -527,7 +522,7 @@ public class TestResourceAwareScheduler { topologies = new Topologies(topoMap); rs.schedule(topologies, cluster1); - newAssignment = (SchedulerAssignmentImpl)cluster1.getAssignmentById(topology1.getId()); + newAssignment = cluster1.getAssignmentById(topology1.getId()); newExecutorToSlot = newAssignment.getExecutorToSlot(); for (ExecutorDetails executor : copyOfOldMapping.keySet()) {
