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

 ##########
 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<>();
 
   private interface JsonConverter {
     Map<String, Boolean> convert(JsonNode jsonNode);
   }
 
-  public CustomRestClientImpl(HttpClient httpClient) {
+  CustomRestClientImpl(HttpClient httpClient) {
     _httpClient = httpClient;
+    _semaphore = new Semaphore(10);
 
 Review comment:
   @i3wangyi  It should be one, right?

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