Github user agresch commented on a diff in the pull request:
https://github.com/apache/storm/pull/2630#discussion_r180804408
--- Diff:
storm-server/src/main/java/org/apache/storm/scheduler/resource/ResourceAwareScheduler.java
---
@@ -100,49 +180,88 @@ private static void markFailedTopology(User u,
Cluster c, TopologyDetails td, St
u.markTopoUnsuccess(td);
}
+ private void cancelAllPendingClusterStateChanged() {
+ if (!schedulingInBackground.isEmpty()) {
+ LOG.warn("Canceling scheduling of {} cluster state changed",
schedulingInBackground.keySet());
+ for (SchedulingPending sp : schedulingInBackground.values()) {
+ sp.cancel();
+ }
+ schedulingInBackground.clear();
+ }
+ }
+
private void scheduleTopology(TopologyDetails td, Cluster cluster,
final User topologySubmitter,
List<TopologyDetails> orderedTopologies)
{
+ LOG.debug("Scheduling {}", td.getId());
+ SchedulingPending sp = schedulingInBackground.get(td.getId());
--- End diff --
lot of code, i would move to method sp = getOrCreateSp() or something.
---