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_r394048847
##########
File path:
helix-core/src/main/java/org/apache/helix/spectator/RoutingTableSnapshot.java
##########
@@ -145,4 +152,34 @@ public RoutingTableSnapshot(RoutingTable routingTable) {
public Collection<ExternalView> getExternalViews() {
return _routingTable.getExternalViews();
}
+
+ /**
+ * Returns a Collection of latest snapshot of CustomizedView. Note that if
the RoutingTable is
+ * instantiated using CurrentStates, this Collection will be empty.
+ * @return
+ */
+ public Collection<CustomizedView> getCustomizeViews() {
+ if (_propertyType.equals(PropertyType.CUSTOMIZEDVIEW)){
+ CustomizedViewRoutingTable customizedViewRoutingTable =
+ (CustomizedViewRoutingTable) _routingTable;
+ return customizedViewRoutingTable.geCustomizedViews();
+ }
+ return Collections.emptySet();
+ }
+
+ /**
+ * Returns the PropertyType associated with this RoutingTableSnapshot
+ * @return
+ */
+ public PropertyType getPropertyType() {
+ return _propertyType;
+ }
+
+ /**
+ * Return the Type associated with thi RoutingTableSnapshot (mainly used for
CustomizedView)
+ * @return
+ */
+ public String getCustomizedStateType() {
Review comment:
getStateType() ?
----------------------------------------------------------------
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]