MultiSliceGet vs Multithreaded get's using SliceQuery

27 views
Skip to first unread message

GV

unread,
May 22, 2013, 2:05:18 AM5/22/13
to hector...@googlegroups.com

Hello,

We are using hector as our java client to communicate with Cassandra.  I had a question around the behavior of the SliceQuery and Multisliceget , I started tracing the call hierarchy and I found out that both these methods call the Read method in the StorageProxy.java class.   So my question is , given a scenario where I need to fetch information for multiple keys, should I use the multisliceget or should I develop multithreaded code to fetch data in a parallel fashion to speed up the query time.  Looking at the fetchRows method in the StorageProxy.java, it appears that it uses a for-loop to iterate over the keylist and calls the messagingservice to read the data.  

  I would appreciate your thoughts and feedback on this.


Thanks

Gv

Nate McCall

unread,
May 22, 2013, 3:07:26 PM5/22/13
to hector...@googlegroups.com
I would recommend multigetSlice - primarily to avoid the overhead of
managing your own threads.

Your are correct in that they do the same thing under the hood, but
Cassandra handles the async request distribution for you in the case
of MultigetSlice.
> --
> You received this message because you are subscribed to the Google Groups
> "hector-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to hector-users...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages