You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/08/23 23:15:27 UTC

[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #4553: Add integration test for ControllerLeaderLocator

mcvsubbu commented on a change in pull request #4553: Add integration test for ControllerLeaderLocator
URL: https://github.com/apache/incubator-pinot/pull/4553#discussion_r317328071
 
 

 ##########
 File path: pinot-core/src/main/java/org/apache/pinot/server/realtime/ControllerLeaderLocator.java
 ##########
 @@ -80,26 +81,27 @@ public static ControllerLeaderLocator getInstance() {
 
   /**
    * Locates the controller leader so that we can send LLC segment completion requests to it.
-   * Checks the {@link ControllerLeaderLocator::_cachedControllerLeaderInvalid} flag and fetches the leader from helix if cached value is invalid
+   * Checks the {@link ControllerLeaderLocator::_cachedValidControllerLeaderMap} and fetches the leader from helix if cached value is invalid or missing.
    * @param rawTableName table name without type.
    * @return The host-port pair of the current controller leader.
    */
   public synchronized Pair<String, Integer> getControllerLeader(String rawTableName) {
-    if (!_cachedControllerLeaderInvalid) {
-      return _controllerLeaderHostPort;
+    Pair<String, Integer> leaderPairForTable = _cachedValidControllerLeaderMap.get(rawTableName);
 
 Review comment:
   I suppose we expect that the number of tables having consuming segments in a host is generally smaller than the number of partitions in the lead controller resource.  If it is the other way around then it will nbe better to cache the partitionId to leader pair. I am fine with this approach for now, but we should at least add a comment that we are taking that approach.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org