Usage of RemoteCache with DeltaAware and Delta interface infinispan

85 views Asked by At

I need some guidance related to the following scenario in infinispan. Here is my scenario:

1) I created two nodes and started successfully in infinispan using client server mode.

2) In the hot rod client I created a remotechachemanager and then obtained a RemoteCache.

3) In the remote cache I put like this cache.put(key, new HashMap()); it is successfully added.

4) Now when I am going to clear this value using cache.remove(key) , I am seeing that it is not getting removed and the hash map is still there every time I go to remove it.

How can clear the value so that it will be cleared from all node of the cluster?

How can I also propagate the changes like adding or removing from the value HashMap above?

Has it anything to do with implementing DeltaAware and Delta interface?

Please suggest me about this concept or some pointers where I can learn

Thank you

1

There are 1 answers

4
Radim Vansa On

Removal of the HashMap should work as long as you use the same key and have equals() and hashCode() correctly implemented on the key. I assume you're using distributed or replicated mode. EDIT: I've realized that equals() and hashCode() are not that important for RemoteCache, since the key is serialized anyway and all the comparison will be executed on the underlying byte[].

Remote cache does not directly support DeltaAware. Generally, using these is quite tricky even in library mode.

If you want to use cache with maps, I suggest rather using composite key like cache-key#map-key than storing complex HashMap.