Hazelcast Predicates

If you're familiar with Vert.x and Hazelcast, you've probably realized the Vert.x AsyncMap is limited compared to Hazelcast's distributed maps. For example, to filter the data in an AsyncMap you must retrieve the entire map data on that node before you can process it. That's okay though, Vert.x does exactly what it needs to.

Hazelcast avoids that by making it possible to run distributed queries using Predicates. Let's say your map data is distributed between 16 different nodes, instead of retrieving all of that data at once, Hazelcast will run a predicate on each node housing the data. This makes life a lot easier.

Recently I wrote a small utility class I simply dubbed ExtendedHazelcastAsyncMap (wow that's a mouthful). The only purpose of the class is to add a method called values(Predicate, Handler) making it possible to do a distributed query with an AsyncMap.

The Code