vrajat commented on code in PR #12157:
URL: https://github.com/apache/pinot/pull/12157#discussion_r1473771585


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -140,6 +142,8 @@ public class PinotLLCRealtimeSegmentManager {
   // Max time to wait for all LLC segments to complete committing their 
metadata while stopping the controller.
   private static final long MAX_LLC_SEGMENT_METADATA_COMMIT_TIME_MILLIS = 
30_000L;
 
+  private Map<Pair<String, String>, SegmentErrorInfo> _errorCache;

Review Comment:
   I should limit its size. I am thinking of using a `LinkedHashMap` to limit 
its entry. Similar to 
https://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html#removeEldestEntry-java.util.Map.Entry-
   
   Is that OK? 
   
   However, these methods are not synchronized. I can use 
[Collections.synchronizedMap](https://docs.oracle.com/javase/8/docs/api/java/util/Collections.html#synchronizedMap-java.util.Map-)
 to wrap the LinkedHashMap. 
   
   Also another minor improvement is to change the signature to 
`getSegmentErrors(String tableName, String segmentName)`. Then iterators and 
streams are not required and all the access will be through `get` which is 
synchronized. 



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

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to