We have the following Map that we store in Hazelcast:
IMap<Long, Team>
The key in the above map is the Team Id.
Each team has a <Set>
of players. Each player has a player id.
We would like to provide a faster access to all the players (belonging to all teams) by providing a map that contains the playerid and the corresponding player. Something like IMap<Long, Player>
.
We do not want to create one more Map to achieve this. Because, we would then need to update/save the Player information twice in hazelcast. Once in the Team map and then again in the Player map.
Is there any configuration that Hazelcast provides by which we can expose all the Players as a Map?
I'm not sure to understood the question itself. It seems to me you want to expose internal data of the Team object to another data structure. This is actually not possible.
What you can do is not storing players inside the team but using the same teamid with a multimap and storing all players there.