kaisun2000 commented on a change in pull request #365: Fix RoutingTableProvider 
statePropagationLatency metric reporting bug
URL: https://github.com/apache/helix/pull/365#discussion_r309460908
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/common/caches/AbstractDataCache.java
 ##########
 @@ -48,15 +50,17 @@ public AbstractDataCache(ControlContextProvider 
controlContextProvider) {
    * Selectively fetch Helix Properties from ZK by comparing the version of 
local cached one with the one on ZK.
    * If version on ZK is newer, fetch it from zk and update local cache.
    * @param accessor the HelixDataAccessor
-   * @param reloadKeys keys needs to be reload
+   * @param reloadKeysIn keys needs to be reload
    * @param cachedKeys keys already exists in the cache
    * @param cachedPropertyMap cached map of propertykey -> property object
+   * @param reloadKeysOut keys actually reloaded; may include more keys than 
reloadKeysIn
    * @return updated properties map
    */
   protected Map<PropertyKey, T> refreshProperties(
-      HelixDataAccessor accessor, List<PropertyKey> reloadKeys, 
List<PropertyKey> cachedKeys,
-      Map<PropertyKey, T> cachedPropertyMap) {
+      HelixDataAccessor accessor, Set<PropertyKey> reloadKeysIn, 
List<PropertyKey> cachedKeys,
+      Map<PropertyKey, T> cachedPropertyMap, Set<PropertyKey> reloadKeysOut) {
 
 Review comment:
   Jiajun suggested this approach.  This method already return other values. So 
we can't put the modified reloaded keys as a return value. Changing the current 
input is definitely confusing. That is the why there is bugs for now. So Jiajun 
suggestion of using a "out" parameter seems to make sense. 
   
   In fact, some language by design has "OUT" parameters. Java can use 
modifiable collections to simulate this behavior. C also commonly use similar 
tricks. 
   
   
https://www.codeproject.com/Questions/167362/how-i-can-use-out-parameter-in-java

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


With regards,
Apache Git Services

Reply via email to