Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2223

Thread safety when storing nested maps inside Redisson RMap

$
0
0

I am using Redisson in a Java environment to make certain data structures distributed so that they can all be accessed from multiple Tomcat instances, in a multi threaded environment.

I plan to have a nested map data structure defined as below:

protected RMap<String, ConcurrentHashMap<String, ConcurrentHashMap<String, Object >>> aMap = new ConcurrentHashMap<>();

As per the Redisson documentation, the RMap is thread safe by default.However I'm not sure what will happen when I'm modifying one of the ConcurrentHashMaps instances nested inside the RMap.Is having Concurrent hash maps inside an RMap a good practice in general to do when using Redisson? Am I paving way for unforeseen concurrency related issues by this approach? If not, what is a better approach?Thanks.


Viewing all articles
Browse latest Browse all 2223

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>