This is an excerpt from the book, HBase in Action, for Scanner caching.
The ResultScanner interface also has a next(int) call that you can use to ask it to return the next n rows from the scan. This is an API convenience that doesn’t have any relation to the number of RPC calls the client makes to HBase to get those n rows. Under the hood, ResultScanner makes as many RPC calls as necessary to satisfy the request; the number of rows returned per RPC call is solely dependent on the caching value you configure for the scanner.
I have 2 doubts pertaining to the above:
- If the next(int) method does not have any relation to the number of RPC calls the client makes to HBase, what purpose does it solve or how and where should it used ?
- The last sentence says that the ResultScanner makes as many RPC calls necessary to satisfy the request. I thought the scanner caching would help decrease the number of round trips or requests to HBase or did I understand it wrong ?