hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kelvin Rawls <kel...@iswcorp.com>
Subject Scan startRow seems to be broke in HBase 0.20.2
Date Mon, 30 Aug 2010 15:25:56 GMT
No matter what I tell it, this seems to return Row IDs from the beginning of the table.

code

    public List<String> getKeys(String lastDoc, int N) {
       List<String> results = new ArrayList<String>();
        try {
            Scan scan = new Scan();
            scan.setStartRow(Bytes.toBytes(lastDoc));
            StringBuilder regExp = new StringBuilder();
            regExp.append("MYROWFLAGTRUE");
            SingleColumnValueFilter scvf = new SingleColumnValueFilter("MYROW".getBytes(),
                            "FLAG".getBytes(), CompareFilter.CompareOp.EQUAL,
                            new RegexStringComparator(regExp.toString()));
                    scvf.setFilterIfMissing(true);
                    scan.setFilter(scvf);
            ResultScanner scanner = table.getScanner(scan);
            for (Result rr : scanner.next(N)) {
                String next_str = Bytes.toString(rr.getRow());
                results.add(next_str);
            }
            scanner.close();
        } catch (IOException ex) {
            m_log.error("Error getting keys", ex);
        }
        m_log.debug("Returning " + results.size() + " ids");
        return results;
   }

Thanks for any help.

Kelvin L. Rawls
 
410-290-6240, office
301-221-1308, cell
703 741-3120, fax
www.iswcorp.com
Mime
View raw message