You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/02/14 02:51:44 UTC
[GitHub] [helix] narendly commented on a change in pull request #761: Add
REST read endpoints to helix-rest for metadata store directory
narendly commented on a change in pull request #761: Add REST read endpoints to helix-rest for metadata store directory
URL: https://github.com/apache/helix/pull/761#discussion_r379227909
##########
File path: helix-rest/src/main/java/org/apache/helix/rest/server/resources/metadatastore/MetadataStoreDirectoryAccessor.java
##########
@@ -66,24 +67,44 @@ private void postConstruct() {
}
/**
- * Gets all metadata store realms in a namespace with the endpoint.
+ * Gets all existing namespaces in the routing metadata store at endpoint:
+ * "GET /metadata-store-namespaces"
+ *
+ * @return Json response of all namespaces.
+ */
+ @GET
+ @Path("/metadata-store-namespaces")
+ public Response getAllNamespaces() {
+ Collection<String> namespaces = _metadataStoreDirectory.getAllNamespaces();
+ Map<String, Collection<String>> responseMap =
+ ImmutableMap.of(MetadataStoreRoutingConstants.METADATA_STORE_NAMESPACES, namespaces);
+
+ return JSONRepresentation(responseMap);
+ }
+
+ /**
+ * Gets all metadata store realms in a namespace at path: "GET /metadata-store-realms",
+ * or gets a metadata store realm with the sharding key at path:
+ * "GET /metadata-store-realms?sharding-key={sharding-key}"
*
* @return Json representation of all realms.
*/
@GET
@Path("/metadata-store-realms")
- public Response getAllMetadataStoreRealms() {
- Map<String, Collection<String>> responseMap;
+ public Response getAllMetadataStoreRealms(@QueryParam("sharding-key") String shardingKey) {
Review comment:
Or better yet, should we consider breaking this up into two different path resources to eliminate if-elses?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org