Sets, lists, and queues
In the previous examples, we looked at key-value storage provided by Hazelcast maps. However, there are a number of other collections that provide keyless groups of objects. Two of these additional types are distributed versions of collections that you may be already familiar with—sets and lists.
The primary difference between these two collections is that lists allow for multiple entries and a set does not. So, if we add them to the previous map example, we will get the following code:
Set<String> cities = hz.getSet("cities"); cities.addAll(captials.values()); cities.add("London"); cities.add("Rome"); cities.add("New York"); List<String> countries = hz.getList("countries"); countries.addAll(captials.keySet()); countries.add("CA"); countries.add("DE"); countries.add("GB"); // duplicate entry
When using the test console again to interact with these new collections, we...