dasahcc commented on a change in pull request #339: Implementation of
stateModelDef modification in REST 2.0
URL: https://github.com/apache/helix/pull/339#discussion_r306579086
##########
File path:
helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/ClusterAccessor.java
##########
@@ -416,24 +418,99 @@ public Response
getClusterStateModelDefinitions(@PathParam("clusterId") String c
return JSONRepresentation(clusterStateModelDefs);
}
- @GET
- @Path("{clusterId}/maintenance")
- public Response getClusterMaintenanceMode(@PathParam("clusterId") String
clusterId) {
- return JSONRepresentation(
- ImmutableMap.of(ClusterProperties.maintenance.name(),
getHelixAdmin().isInMaintenanceMode(clusterId)));
- }
-
@GET
@Path("{clusterId}/statemodeldefs/{statemodel}")
public Response getClusterStateModelDefinition(@PathParam("clusterId")
String clusterId,
@PathParam("statemodel") String statemodel) {
HelixDataAccessor dataAccessor = getDataAccssor(clusterId);
- StateModelDefinition stateModelDef =
-
dataAccessor.getProperty(dataAccessor.keyBuilder().stateModelDef(statemodel));
+ StateModelDefinition stateModelDef =
dataAccessor.getProperty(dataAccessor.keyBuilder().stateModelDef(statemodel));
+ if (stateModelDef == null) {
+ return badRequest("statemodel not found!");
Review comment:
Let's keep the style consistent of capitalizing the first char of a word as
you did for all other exceptions or logs. "Statemodel not found!"
----------------------------------------------------------------
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