xyuanlu commented on code in PR #2702:
URL: https://github.com/apache/helix/pull/2702#discussion_r1400037249


##########
helix-core/src/main/java/org/apache/helix/controller/dataproviders/BaseControllerDataProvider.java:
##########
@@ -335,6 +338,107 @@ private void refreshInstanceConfigs(final 
HelixDataAccessor accessor,
     }
   }
 
+  /**
+   * Refreshes the assignable instances and SWAP related caches. This should 
be called after
+   * liveInstance and instanceConfig caches are refreshed. To determine what 
instances are
+   * assignable and live, it takes a combination of both the all 
instanceConfigs and liveInstances.
+   *
+   * @param instanceConfigMap InstanceConfig map from instanceConfig cache
+   * @param liveInstancesMap  LiveInstance map from liveInstance cache
+   * @param clusterConfig     ClusterConfig from clusterConfig cache
+   */

Review Comment:
   Please add TODO for evacuation as well.



##########
helix-core/src/main/java/org/apache/helix/controller/dataproviders/BaseControllerDataProvider.java:
##########
@@ -103,7 +103,9 @@ public class BaseControllerDataProvider implements 
ControlContextProvider {
   // Property caches
   private final PropertyCache<ResourceConfig> _resourceConfigCache;
   private final PropertyCache<InstanceConfig> _instanceConfigCache;
+  private final Map<String, InstanceConfig> _assignableInstanceConfigMap = new 
HashMap<>();

Review Comment:
   nit: Probably we can move these 2 lines out of the `Property caches` code 
block and have more detailed comments. Like what instances are counted as 
"assignable". 



##########
helix-core/src/main/java/org/apache/helix/controller/changedetector/ResourceChangeSnapshot.java:
##########
@@ -82,10 +82,10 @@ class ResourceChangeSnapshot {
     _changedTypes = new HashSet<>(dataProvider.getRefreshedChangeTypes());
 
     _instanceConfigMap = ignoreNonTopologyChange ?

Review Comment:
   Do we want to change the name of `_instanceConfigMap ` as well? If user call 
`getInstanceConfigMap` it may be confusing. 



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

To unsubscribe, e-mail: [email protected]

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