-
1. Re: Using DistributedCallable for search/filtering
vblagojevic Oct 24, 2012 10:35 AM (in response to srininara)1 of 1 people found this helpfulDo a map/reduce on your Infinispan cluster. Each time you find a person from a certain city emit count 1. In reducer just add them up. See WordCount map/reduce demo in demos module for inspiration and further guidance.
Regards,
Vladimir
-
2. Re: Using DistributedCallable for search/filtering
srininara Oct 25, 2012 3:28 AM (in response to vblagojevic)Thanks Vladimir for the response. Based on your input, I did some quick read through of the MapReduceTask and supporting classes code from Github. The MapReduceManagerImpl internally seems to be using cache.keyset() and DistributionManager related methods to find out whether the key is local or not. I think I can do the same thing in my DistributedCallable. Let me know if you have any conerns. I will make changes and try it out and post the code as soon as possible.
Thanks,
Srini
-
3. Re: Using DistributedCallable for search/filtering
vblagojevic Nov 1, 2012 4:46 PM (in response to srininara)Yes, calling cache#keySet() from DistributeCallable should possibly do the trick. Keep us updated about your progress.
Regards,
Vladimir
-
4. Re: Using DistributedCallable for search/filtering
srininara Nov 4, 2012 5:33 AM (in response to vblagojevic)I was able to do this. Please find the code at my github repo.
I could not use the direct method in DistributionManger.getLocality(key).isLocal() - it kept returning true always. So I had to compare addresses. That worked
On a related note, I was trying to figure out a way to achieve pagination. For that it seems I have to use Hibernate query only. If there is a different way, please do let me know. If you want me to start a different thread for this, please let me know and I will immediately do that.
Thanks,
Srini