fabriziofortino commented on a change in pull request #309:
URL: https://github.com/apache/jackrabbit-oak/pull/309#discussion_r662456245
##########
File path:
oak-segment-remote/src/main/java/org/apache/jackrabbit/oak/segment/remote/persistentcache/PersistentDiskCache.java
##########
@@ -63,15 +63,10 @@
final AtomicLong evictionCount = new AtomicLong();
- private static final Comparator<Path> sortedByAccessTime = (path1, path2)
-> {
- try {
- FileTime lastAccessFile1 = Files.readAttributes(path1,
BasicFileAttributes.class).lastAccessTime();
- FileTime lastAccessFile2 = Files.readAttributes(path2,
BasicFileAttributes.class).lastAccessTime();
- return lastAccessFile1.compareTo(lastAccessFile2);
- } catch (IOException e) {
- logger.error("A problem occurred while cleaning up the cache: ",
e);
- }
- return 0;
+ private static final Comparator<SegmentCacheEntry> sortedByAccessTime =
(segmentCacheEntry1, segmentCacheEntry2) -> {
Review comment:
One more thing here: since you now have `SegmentCacheEntry` you could
make it implement `Comparable` and move this logic in there. Then you need to
call `sorted` on the stream below without arguments.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]