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

 ##########
 File path: 
helix-rest/src/main/java/org/apache/helix/rest/client/CustomRestClientImpl.java
 ##########
 @@ -52,16 +56,26 @@
   private static final String ACCEPT_CONTENT_TYPE = "application/json";
   private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
 
-  private HttpClient _httpClient;
+  private final HttpClient _httpClient;
+  private final Semaphore _semaphore;
+  // a transient cache holds the HttpResponse of HttpPosts, only valid when 
cache is enabled
+  private final Map<Integer, HttpResponse> _cachedResults = new HashMap<>();
 
 Review comment:
   No, we don't need to, a new instance of CustomRestClientImpl instead of 
singleton will be created per each request. That's the idea of keeping rest 
service stateless 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to