Distributed query when value in IMap is hashMap

163 views
Skip to first unread message

Reed Wang

unread,
Oct 4, 2014, 12:39:50 AM10/4/14
to haze...@googlegroups.com
Hi there, we have some requirement that the object field length stored in hazelcast IMap is dynamic so I choose HashMap to store the data, kind of like:
HazelcastInstance hz = Hazelcast.newHazelcastInstance(config);

IMap<String, Map<String, String>> map = hz.getMap("mapTest");



We also have needs to do some distributed query for this IMap, unfortunately when I tried error occurs:

Caused by: com.hazelcast.query.impl.QueryException: java.lang.IllegalArgumentException: There is no suitable accessor for 'wzk' on class 'class java.util.HashMap'

So currently there is no way for hazelcast to support this dynamic object and do a distributed query?

noctarius

unread,
Oct 4, 2014, 10:03:52 AM10/4/14
to haze...@googlegroups.com

Hi Reed,

Instead of using a HashMap you might want to go for serializing to JSON or you have to write your own predicates.

Chris

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at http://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/328137d4-3e28-47fb-ba1f-a8aa0b561bb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reed Wang

unread,
Oct 4, 2014, 10:44:25 AM10/4/14
to haze...@googlegroups.com
Thanks for the reply Chris, I think if I stored like JSON that I still couldn't use existing predicates right? maybe generate dynamic class is one way.

在 2014年10月4日星期六UTC+8下午10时03分52秒,Christoph Engelbert写道:
Reply all
Reply to author
Forward
0 new messages