Github user jerrypeng commented on a diff in the pull request:
https://github.com/apache/storm/pull/921#discussion_r46721248
--- Diff:
storm-core/src/jvm/backtype/storm/scheduler/resource/ResourceAwareScheduler.java
---
@@ -28,94 +32,272 @@
import backtype.storm.scheduler.Topologies;
import backtype.storm.scheduler.TopologyDetails;
import backtype.storm.scheduler.WorkerSlot;
-import backtype.storm.scheduler.resource.strategies.ResourceAwareStrategy;
+import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
public class ResourceAwareScheduler implements IScheduler {
+
+ private Map<String, User> userMap;
+ private Cluster cluster;
+ private Topologies topologies;
+ private RAS_Nodes nodes;
+
+ private class SchedulingState {
+ private Map<String, User> userMap = new HashMap<String, User>();
+ private Cluster cluster;
+ private Topologies topologies;
+ private RAS_Nodes nodes;
+ private Map conf = new Config();
+
+ public SchedulingState(Map<String, User> userMap, Cluster cluster,
Topologies topologies, RAS_Nodes nodes, Map conf) {
+ for (Map.Entry<String, User> userMapEntry :
userMap.entrySet()) {
+ String userId = userMapEntry.getKey();
+ User user = userMapEntry.getValue();
+ this.userMap.put(userId, user.getCopy());
+ }
+ this.cluster = cluster.getCopy();
+ this.topologies = topologies.getCopy();
+ this.nodes = new RAS_Nodes(this.cluster, this.topologies);
+ this.conf.putAll(conf);
+
+ }
+ }
+
+
+ @SuppressWarnings("rawtypes")
+ private Map conf;
+
private static final Logger LOG = LoggerFactory
.getLogger(ResourceAwareScheduler.class);
- @SuppressWarnings("rawtypes")
- private Map _conf;
@Override
public void prepare(Map conf) {
- _conf = conf;
+ this.conf = conf;
+
}
@Override
public void schedule(Topologies topologies, Cluster cluster) {
- LOG.debug("\n\n\nRerunning ResourceAwareScheduler...");
+ LOG.info("\n\n\nRerunning ResourceAwareScheduler...");
--- End diff --
will change
---
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.
---