NealSun96 commented on a change in pull request #844: Implement setRoutingData
for MetadataStoreDirectoryService
URL: https://github.com/apache/helix/pull/844#discussion_r387323377
##########
File path:
helix-rest/src/main/java/org/apache/helix/rest/metadatastore/accessor/ZkRoutingDataWriter.java
##########
@@ -332,20 +350,21 @@ private String constructUrlSuffix(String... urlParams) {
return String.join("", allUrlParameters);
}
- private boolean forwardRequestToLeader(String urlSuffix,
HttpConstants.RestVerbs request_method,
- int expectedResponseCode) throws IllegalArgumentException {
+ private boolean buildAndSendRequestToLeader(String urlSuffix,
+ HttpConstants.RestVerbs requestMethod, int expectedResponseCode)
+ throws IllegalArgumentException {
String leaderHostName = _leaderElection.getCurrentLeaderInfo().getId();
String url = leaderHostName + urlSuffix;
HttpUriRequest request;
- switch (request_method) {
+ switch (requestMethod) {
case PUT:
request = new HttpPut(url);
break;
case DELETE:
request = new HttpDelete(url);
break;
default:
- LOG.error("Unsupported request_method: " + request_method.name());
+ LOG.error("Unsupported requestMethod: " + requestMethod.name());
Review comment:
This is a strange one because it can only go to `default` because of
developer oversights.
If some code using the wrong http verb does make it to production, and
clients are calling the endpoints with the incorrect code, we definitely want
to report 500 to clients (return false) instead of 400
(`IllegalArgumentException`).
I'll change it to exception because `return false` isn't informative enough
to developers, but I wish there's a way to limit the values of a parameter.
----------------------------------------------------------------
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]