RE: LQC: How to know the cached item size and cached items

It took me exactly 3 minutes to find the following code in LQC (QueryView.java)

        // Evict items from cache if cache size exceeds max cache size
        int counter = 0;
        while (itemCache.size() > maxCacheSize) {

There are methods to set and retrieve the maxCacheSize. The container only contains maxCacheSize items. The table cache is separate.

You could have saved 47hours and 7 minutes.

Hi Jean,
Thanks for the nice response. I looked for a while to QueryView.java but I am not able to find the method that can return me item ids that are currently cache. I was hoping it should be simple enough but this class is final and most of the useful methods in LazyQueryContainer are final so that is creating trouble to get what I want. I am sure I am missing something but if you can point me to that API that gives the cached item ids that will be great. Obviously getItemIds() API is giving me all the Ids and not only cached one so that is almost useless API for me.

Thanks

Hello,

  1. There is no currently no method to do what you want (return the itemIds of the items in the cache). Why? Because there was previously no need - doesn’t seem like a common requirement.

  2. The source is there - it looks trivial to add the functionality you want. (add a method to LazyQueryView to return a copy of either keyset of propertyItemMapCache, or return a copy of itemCacheAccessLog). Yes, you’d have to fork the source code in your App (or do a pull request in Git) : this is opensource.

  3. I didn’t write the addon. I don’t use the add-on. I don’t have the source for the add-on. I didn’t respond previously as I have no experience or knowledge of the add-on. I went and looked at the source in GitHub - moaning that no-one has helped you means I am less like to do so again in the future.

Charles.