bipinprasad commented on a change in pull request #3136: [STORM-3519] Change 
ConstraintSolverStrategy::backtrackSearch to iteration
URL: https://github.com/apache/storm/pull/3136#discussion_r334562680
 
 

 ##########
 File path: 
storm-server/src/main/java/org/apache/storm/scheduler/resource/strategies/scheduling/ConstraintSolverStrategy.java
 ##########
 @@ -320,51 +320,101 @@ private boolean checkSchedulingFeasibility(int 
maxStateSearch) {
         return 
GenericResourceAwareStrategy.sortObjectResourcesImpl(allResources, exec, 
topologyDetails, existingScheduleFunc);
     }
 
-    // Backtracking algorithm does not take into account the ordering of 
executors in worker to reduce traversal space
+    /**
+     * Try to schedule till successful or till limits (backtrack count or 
time) have been exceeded.
+     *
+     * @param state terminal state of the executor assignment.
+     * @return SolverResult with success attribute set to true or false 
indicting whether ALL executors were assigned.
+     */
     @VisibleForTesting
     protected SolverResult backtrackSearch(SearcherState state) {
-        state.incStatesSearched();
-        if (state.areSearchLimitsExceeded()) {
-            LOG.warn("Limits Exceeded");
-            return new SolverResult(state, false);
-        }
+        long         startTimeMilli     = System.currentTimeMillis();
 
 Review comment:
   We need real time here therefore the use of System. Time.currentTimeMillis() 
does not give actual time, but time that can be manipulated by mock (used in 
test)

----------------------------------------------------------------
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