ahanikel commented on PR #1155:
URL: https://github.com/apache/jackrabbit-oak/pull/1155#issuecomment-1768191906

   @amit-jain I think the least recently used entries in the cache 
automatically fall off the cliff when the maxSize is reached, but I've still 
added an expiration of 15 minutes, so we don't waste memory unnecessarily.
   
   I've added my test to the tests in CachingDataStoreTest. I've also tried to 
use Mockito but it does not seem to work in this case (modifying the class 
variable seems to be ignored somehow in the mocking process).
   
   > Overall, I think the call need not go to the backend in case the the 
corresponding file is available in the cache.
   Yes, but my understanding is that we try to avoid loading the blob if we 
don't need it, and so if we only call `backend.getRecord()` it never ends up in 
the existing cache, and therefore `getRecordIfStored()` always falls back to 
`backend.getRecord()`. If my understanding is wrong, then there must be 
something else at play, because the recordCache has a measurable impact on 
performance (I've put the details on my internal git.corp account 
unfortunately, the link is in GRANITE-47685).


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

Reply via email to