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_r390013587
##########
File path:
helix-core/src/main/java/org/apache/helix/spectator/RoutingTableProvider.java
##########
@@ -237,7 +332,42 @@ public void shutdown() {
* @return snapshot of current routing table.
*/
public RoutingTableSnapshot getRoutingTableSnapshot() {
- return new RoutingTableSnapshot(_routingTableRef.get());
+ String key = getRoutingTableKey();
+ return new RoutingTableSnapshot(_routingTableRef.get(key).get());
+ }
+
+ /**
+ * Get an snapshot of current RoutingTable information for specific
PropertyType.
+ * The snapshot is immutable, it reflects the routing table information at
the time this method is
+ * called.
+ * @return snapshot of current routing table.
+ */
+ public RoutingTableSnapshot getRoutingTableSnapshot (PropertyType
propertyType) {
+ String key = getRoutingTableKey(propertyType);
+ return new RoutingTableSnapshot(_routingTableRef.get(key).get());
+ }
+
+ /**
+ * Get an snapshot of all of the available RoutingTable information. The
snapshot is immutable, it
+ * reflects the routing table information at the time this method is called.
+ * @return snapshot associated with specific propertyType and type.
+ */
+ public RoutingTableSnapshot getRoutingTableSnapshot(PropertyType
propertyType, String type) {
+ String key = getRoutingTableKey(propertyType, type);
+ return new RoutingTableSnapshot(_routingTableRef.get(key).get());
+ }
+
+ /**
+ * Get an snapshot of all of the available RoutingTable information. The
snapshot is immutable, it
+ * reflects the routing table information at the time this method is called.
+ * @return all of the available snapshots of current routing table.
+ */
+ public Map<String, RoutingTableSnapshot> getRoutingTableSnapshots() {
Review comment:
I would suggest making the return more comprehensive.
Map<String (path), Map<String (type), RoutingTableSnapshot>>
----------------------------------------------------------------
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]