This content has been marked as final. Show 2 replies
Assuming you are using POF then on the cluster the values in the Local Cache will be a Binary key and a Binary value. As Binary is immutable it is not possible to change the value referenced by the Local Cache.
Now, this changes for some types of cache where the value is held deserialized, for example a CQC, where you can mutate the value and this mutates the underlying value in the cache. This is exactly the same thing that happens in pretty much every Map implementation in Java though.
Thanks for the reply, Jonathan. I am not using POF in my local cache and it is not a clustered like in CQC or near cache. It is a stand alone localcache embedded in my tomcat JVM. I did verify that it works in the same manner as a java.util.Map but I was wondering how the size (in bytes) based eviction and notifications work in this case. For e.g. when I mutate an object graph after I do a get and keep holding on to it in my client thread, how do you determine whether it is a candidate for eviction, etc? Do you also periodically traverse through each object and all its child references in order do evictions so my cache size is always kept under the high watermark? Hope this makes sense in the context of LocalCache and I am not missing something obvious in terms of its behavior.