govind-menon commented on a change in pull request #3022: STORM-3407 Storm 2.x 
ConstraintSolverStrategy backward compatibility
URL: https://github.com/apache/storm/pull/3022#discussion_r291715072
 
 

 ##########
 File path: 
storm-server/src/main/java/org/apache/storm/scheduler/resource/strategies/scheduling/ConstraintSolverStrategy.java
 ##########
 @@ -248,10 +247,22 @@ public SchedulingResult schedule(Cluster cluster, 
TopologyDetails td) {
         nodes = RAS_Nodes.getAllNodesFrom(cluster);
         Map<WorkerSlot, Set<String>> workerCompAssignment = new HashMap<>();
         Map<RAS_Node, Set<String>> nodeCompAssignment = new HashMap<>();
-        //set max number of states to search
-        final int maxStateSearch = Math.min(MAX_STATE_SEARCH,
-                                            
ObjectReader.getInt(td.getConf().get(Config.TOPOLOGY_RAS_CONSTRAINT_MAX_STATE_SEARCH),
-                                                                
DEFAULT_STATE_SEARCH));
+
+        //set max number of states to search maintaining backward 
compatibility for old topologies
+        String stormVersionString = td.getTopology().get_storm_version();
+        boolean isNewTopology = stormVersionString != null && 
stormVersionString.startsWith("2");
+
+        Object confMaxStateSearch = null;
+        if (isNewTopology == false) {
 
 Review comment:
   nit: rename to is2xTopology

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to