jiajunwang commented on a change in pull request #367: Add transient cache for 
CustomRestClient implementation
URL: https://github.com/apache/helix/pull/367#discussion_r309569490
 
 

 ##########
 File path: 
helix-rest/src/main/java/org/apache/helix/rest/client/CustomRestClientImpl.java
 ##########
 @@ -122,18 +146,23 @@ protected JsonNode getJsonObject(HttpResponse 
httpResponse) throws IOException {
 
   @VisibleForTesting
   protected HttpResponse post(String url, Map<String, String> payloads) throws 
IOException {
+    HttpPost postRequest = new HttpPost(url);
+    postRequest.setHeader("Accept", ACCEPT_CONTENT_TYPE);
+    StringEntity entity = new 
StringEntity(OBJECT_MAPPER.writeValueAsString(payloads), 
ContentType.APPLICATION_JSON);
+    postRequest.setEntity(entity);
+    HttpResponse httpResponse;
+    int hashCode = url.hashCode() + payloads.hashCode();
 
 Review comment:
   url1 has hash = 1 and payloads1 has hash = 3.
   url2 has hash = 2 and payloads2 has hash = 2.
   Their merged hashCode will be the same with this code.

----------------------------------------------------------------
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

Reply via email to