jiajunwang commented on a change in pull request #834: Complete the Routing 
Table Provider for CustomizedView
URL: https://github.com/apache/helix/pull/834#discussion_r390010982
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/spectator/RoutingTableProvider.java
 ##########
 @@ -106,61 +115,131 @@ public RoutingTableProvider(HelixManager helixManager, 
PropertyType sourceDataTy
    */
   public RoutingTableProvider(HelixManager helixManager, PropertyType 
sourceDataType,
       boolean isPeriodicRefreshEnabled, long periodRefreshInterval) throws 
HelixException {
-    _routingTableRef = new AtomicReference<>(new RoutingTable());
+    this(helixManager, ImmutableMap.of(sourceDataType, 
Collections.emptyList()),
+        isPeriodicRefreshEnabled, periodRefreshInterval);
+  }
+
+  /**
+   * Initialize an instance of RoutingTableProvider
+   * @param helixManager
+   * @param sourceDataTypes
+   * @param isPeriodicRefreshEnabled true if periodic refresh is enabled, 
false otherwise
+   * @param periodRefreshInterval only effective if isPeriodRefreshEnabled is 
true
+   * @throws HelixException
+   */
+  public RoutingTableProvider(HelixManager helixManager,
+      Map<PropertyType, List<String>> sourceDataTypes, boolean 
isPeriodicRefreshEnabled,
+      long periodRefreshInterval) throws HelixException {
+
+    // Check and validate the input of the sourceDataTypes parameter
+    for (PropertyType propertyType : sourceDataTypes.keySet()) {
+      if (propertyType.equals(PropertyType.CUSTOMIZEDVIEW)
 
 Review comment:
   nit, Make this a private method?
   And maybe we can simplify it little bit. I understand this is for clearly 
log the error. But we can also put the error message more briefly and log the 
type/path details in the error log so we can debug.

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

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

Reply via email to