Regarding Hazelcast Indexing

98 views
Skip to first unread message

revanthba...@gmail.com

unread,
May 23, 2017, 1:31:42 AM5/23/17
to Hazelcast
Hi,

I was trying to add index value into IMap while inserting into Cache for the first time iteself.

public class Event{
        private int eventId;
private String eventName;
private String countryCode;
}
in my insert operation which is another class, i was trying to insert into map by iterating a list:

               for(int i=0;i<TestPOC.getObjectList().size();i++){
mapObject.put(i, TestPOC.getObjectList().get(i));
mapObject.addIndex("eventName", false);

}

Exception Occured: Exception in thread "main" com.hazelcast.query.QueryException: java.lang.IllegalArgumentException: There is no suitable accessor for 'Event Name' on class 'class com.walmart.model.Event'

I am not understanding whats the issue here. Please help me out




Noctarius

unread,
May 23, 2017, 1:52:13 AM5/23/17
to Christoph Engelbert - Hazelcast
Hey Revanth,

Please do not post the same question multiple times, it is very hard to follow up on different threads otherwise :-)

To your question, you should add the index only once (for example before the loop) but that is (I guess) not the issue. Have you tried adding getters / setters to the Event class?

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 https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/5b42fe3e-4e12-486d-8a58-2843ef132a0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Revanth Balabommala

unread,
May 23, 2017, 9:17:21 AM5/23/17
to Hazelcast

Hi, Christoph,

Yes i had the getters and setters to the event object. Eventhough i removed the for loop and tried to add only single entry into the cache with index specified. But still getting the same exception

Noctarius

unread,
May 23, 2017, 9:35:48 AM5/23/17
to Christoph Engelbert - Hazelcast
Hey,

Can you share an example to reproduce the issue? It most probably is a very small, wrong thing :)

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 https://groups.google.com/group/hazelcast.
Reply all
Reply to author
Forward
0 new messages