lei-xia commented on a change in pull request #1413:
URL: https://github.com/apache/helix/pull/1413#discussion_r499749749



##########
File path: 
helix-core/src/main/java/org/apache/helix/controller/dataproviders/BaseControllerDataProvider.java
##########
@@ -428,13 +463,32 @@ public synchronized void setIdealStates(List<IdealState> 
idealStates) {
   }
 
   /**
-   * Returns the LiveInstances for each of the instances that are curretnly up 
and running
+   * Returns the LiveInstances for each of the instances that are currently up 
and running
    * @return
    */
   public Map<String, LiveInstance> getLiveInstances() {
-    return _liveInstanceCache.getPropertyMap();
+    return getLiveInstances(false);
+  }
+
+  /**
+   * Returns the LiveInstances for each of the instances that are currently up 
and running
+   * @param filterTimedOutInstances - Only set true during maintenance mode. 
If true, filter out
+   *                                instances that are timed-out during 
maintenance mode; instances
+   *                                are timed-out if they have been offline 
for a while before going
+   *                                live during maintenance mode.
+   * @return
+   */
+  public Map<String, LiveInstance> getLiveInstances(boolean 
filterTimedOutInstances) {

Review comment:
       Can we cache the results somewhere (we may already have it?) instead of 
computing everytime this method is called?  I think gertLiveInstances are 
called in many places during one pipeline.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to