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

StackOverflow https://stackoverflow.com/questions/20661450

  •  19-09-2022
  •  | 
  •  

Question

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

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top