1
votes

I am using HBase JAVA/Scala API and have a list of rowids List(1,2,5) and want to retrieve rows corresponding to those ids at the same time.

val getOne = new Get(Bytes.toBytes("1"))

Let's me access only 1 row and I don't want to do get(1) get(2) and get(5) sequentially (latency).

How would I do all at once and iterate through the return set later?

If API does not offer it what is the next best way?

2

2 Answers

0
votes

So the answer is easy list of gets Result[] get(List gets) throws IOException

0
votes

You just have to construct multiple "Get" requests and use the below method from the HTable.

  Result[] get(List<Get> gets)

Link to the javadoc is here.