Get object from the Map during MapLoader call

15 views
Skip to first unread message

eug...@strokin.info

unread,
May 20, 2016, 7:51:47 AM5/20/16
to Hazelcast
Hello,
I have a weird use case.
- I have a IMap which contains some data.
- The IMap has a Map Loader which gets the data from DB if missing.
It's all normal till now.
But the MapLoader in some cases not just getting data but also makes some calculations based on the data and return the result.
The original value could be already loaded into the map, so I wanted to check if it is there and use it for the calculation before even go to DB, so the Load Operation would be faster. But obviously I'm getting IllegalThreadStateException because I'm calling Get from the operations thread.
Is anyway to still get the data from the map instead of going to the DB? The DB calls are expensive, and such work around would improve the performance a lot.

Thanks for any ideas or comments,
Eugene
Reply all
Reply to author
Forward
0 new messages