You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by 史英杰 <sh...@gmail.com> on 2012/02/13 09:23:42 UTC
SOS! No data returned using scan in region server side
When modifying the source code of HBase, I met a problem. In the
regionserver side of HBase , I want to use the function scan to get
all the data in the specified region. In the region, there are more
than one version of data that match one rowkey. the code is shown
below:
Scan scan = new Scan(range.getStartRow());
scan.setMaxVersions(range.getMaxVersions());
long scannerId = this.openScanner(range.getRegionName(), scan);
int nbRows = Integer.parseInt(new String(range.getEndRow())) -
Integer.parseInt(new String(range.getStartRow()));
Result[] results = this.next(scannerId, nbRows);
But the problem is that, after getting the results that returned by
"this.next( )", I found that for every rowkey there is no data
returned.
The functions openScanner() and next() are called by the client side
function getScanner. Why I get no data?
Thank you very much.
Yu Zhang
Re: SOS! No data returned using scan in region server side
Posted by Jean-Daniel Cryans <jd...@apache.org>.
So is the issue that you are getting the Results back but they only
have row keys or is it that you don't get any Result? Either way,
double check your code.
J-D
On Mon, Feb 13, 2012 at 12:23 AM, 史英杰 <sh...@gmail.com> wrote:
> When modifying the source code of HBase, I met a problem. In the
> regionserver side of HBase , I want to use the function scan to get
> all the data in the specified region. In the region, there are more
> than one version of data that match one rowkey. the code is shown
> below:
>
> Scan scan = new Scan(range.getStartRow());
> scan.setMaxVersions(range.getMaxVersions());
> long scannerId = this.openScanner(range.getRegionName(), scan);
> int nbRows = Integer.parseInt(new String(range.getEndRow())) -
> Integer.parseInt(new String(range.getStartRow()));
> Result[] results = this.next(scannerId, nbRows);
>
> But the problem is that, after getting the results that returned by
> "this.next( )", I found that for every rowkey there is no data
> returned.
> The functions openScanner() and next() are called by the client side
> function getScanner. Why I get no data?
> Thank you very much.
>
> Yu Zhang