Q:

Hazelcast query to get Map based on keyset and predicate

I have a hazelcast IMAP which looks like
IMAP = key -> val1, val2, val3

indexed on val1, val2
I am trying to get say key->val2 given the set of Keys
hzObj.getMap("testMap").getAll(keys.toSet.asJava)
which returns the key->val1, val2, val3

Need help to write predicate which says to return only key->val2
Please help

A:

@nocturnal, please see example usage below:

imap.project(Projections.singleAttribute("val2"), Predicates.in("__key", new String[]{"key1, key2"}));

One important note, that'll require you to define an index on key as well.
Since this will be using query threads, you can also use imap.getAll(Set keys) instead & then just convert it to Collection of val2. 

