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

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/spectator/RoutingTable.java
 ##########
 @@ -30,53 +30,80 @@
 import java.util.Set;
 import java.util.TreeSet;
 
+import org.apache.helix.PropertyType;
 import org.apache.helix.model.CurrentState;
+import org.apache.helix.model.CustomizedView;
 import org.apache.helix.model.ExternalView;
 import org.apache.helix.model.InstanceConfig;
 import org.apache.helix.model.LiveInstance;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * A class to consume ExternalViews of a cluster and provide {resource, 
partition, state} to
- * {instances} map function.
+ * A class to consume ExternalViews or CustomizedViews of a cluster and provide
+ * {resource, partition, state} to {instances} map function.
  */
 class RoutingTable {
   private static final Logger logger = 
LoggerFactory.getLogger(RoutingTable.class);
 
   // mapping a resourceName to the ResourceInfo
   private final Map<String, ResourceInfo> _resourceInfoMap;
+
   // mapping a resource group name to a resourceGroupInfo
   private final Map<String, ResourceGroupInfo> _resourceGroupInfoMap;
 
   private final Collection<LiveInstance> _liveInstances;
   private final Collection<InstanceConfig> _instanceConfigs;
   private final Collection<ExternalView> _externalViews;
+  private final Collection<CustomizedView> _customizedViews;
+
+  private final PropertyType _propertyType;
+  private final String _aggregationType;
 
   public RoutingTable() {
     this(Collections.<ExternalView> emptyList(), Collections.<InstanceConfig> 
emptyList(),
         Collections.<LiveInstance> emptyList());
   }
 
+  public RoutingTable(PropertyType propertyType, String aggregationType) {
+    this(Collections.<ExternalView> emptyList(), Collections.<CustomizedView> 
emptyList(), Collections.<InstanceConfig> emptyList(),
+        Collections.<LiveInstance> emptyList(), propertyType, aggregationType);
+  }
+
   public RoutingTable(Map<String, Map<String, Map<String, CurrentState>>> 
currentStateMap,
       Collection<InstanceConfig> instanceConfigs, Collection<LiveInstance> 
liveInstances) {
     // TODO Aggregate currentState to an ExternalView in the RoutingTable, so 
there is no need to
     // refresh according to the currentStateMap. - jjwang
-    this(Collections.<ExternalView> emptyList(), instanceConfigs, 
liveInstances);
+    this(Collections.<ExternalView> emptyList(), Collections.<CustomizedView> 
emptyList(),
+        instanceConfigs, liveInstances, PropertyType.CURRENTSTATES, null);
     refresh(currentStateMap);
   }
 
   public RoutingTable(Collection<ExternalView> externalViews,
       Collection<InstanceConfig> instanceConfigs, Collection<LiveInstance> 
liveInstances) {
+    this(externalViews, Collections.<CustomizedView> emptyList(), 
instanceConfigs, liveInstances,
+        PropertyType.EXTERNALVIEW, null);
+  }
+
+  protected RoutingTable(Collection<ExternalView> externalViews,
 
 Review comment:
   Java doc for the new constructor.

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