FAQ
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

Search Discussions

  • Jean-Daniel Cryans at Feb 13, 2012 at 10:31 pm
    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, 史英杰 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categorieshbase, hadoop
postedFeb 13, '12 at 8:24a
activeFeb 13, '12 at 10:31p
posts2
users2
websitehbase.apache.org

2 users in discussion

Jean-Daniel Cryans: 1 post 史英杰: 1 post

People

Translate

site design / logo © 2022 Grokbase