简体   繁体   中英

Cassandra , Hector :how to retrieve specific set of columns for specific keys from a column family in 1 call?

If there are row keys List rowkeys and for every row key i want some specific set of columns , for some row keys columns might be different and for some row keys they might be different.

How can i do it in Hector ?

mutliget_slice methods requires keys to be in range plus it does not allow 
different ranges for different keys too.

I am not able to find any relevant Hector class which fulfils this requirement of multiget

EDIT:-

I could not find any way , currently i am using mutliget_slice with combined list of columns for all keys and then filtering

You don't.

The native Java driver ( https://github.com/datastax/java-driver ) addresses this by making everything asynchronous, so you can easily request appropriate columns from a bunch of rows, then wait for all the results. (This has no more overhead than a multiget.)

That said, if you can denormalize into a separate table instead of doing a multiget, that's probably best of all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM