简体   繁体   中英

Row retrieval during scan in hbase

I have a doubt regarding the order in which the rows are retrieved in Hbase during the table scan. If my row-keys are as follows ;

id1,id2,id3,id4,id5

I know that they are stored in sorted(ascending) order can you tell me if they are retrieved in the same order as well ie ;

id1,id2,id3,id4,id5

Yes they are restored in the same order. When you scan, there are 2 ways to retrieve the results.

A) Retrieve each row one by one, where a marker is maintained, and incremented on every get. scannerGet()

B) Retrieve n number of rows at once, where the order is maintained. scannerGetList(numberofrowsreqd). You can do this in a while loop.

while(true)
{
  List<TRowResult> list = scannerGetList(scannerId,numberofRows);
  if(list.Count == 0)
  {
   break;
  }
}

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