HDDS-10156. Optimize Snapshot Cache get and eviction
What changes were proposed in this pull request?
Currently SnapshotCache does a cleanup on every operation performed on the cache which is synchronized operation which overall makes the get,release operation non performant. A better approach would be introduce a background service which will periodically come up and perform a cleanup of all the unreferenced snapshot instances.
HDDS-10103 removed pending eviction list to avoid deadlock issues which means we have to check each and every snapshot instance in the cache if it has any references. If we use the concurrentHashSet for the pendingEvictionSet instead we can avoid such deadlock issues from occuring and it would be optimized at the same time.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10156
How was this patch tested?
Adding unit tests and integration tests and existing tests should also help
Why is this a Draft?
Why is this a Draft?
I haven't added the unit test yet. I am working on it.
@swamirishi can you please fix the check-style and unit tests?
Thank you for the review @hemantk-12 @aswinshakil