在 scan.setCaching(cacheRow) 中设置较高值时,Hbase 扫描不返回所有行

lav*_*gal 5 hbase

    Scan s = new Scan();
    s.addFamily(Bytes.toBytes("cf1"));
    s.setCaching(cacheRows);
    s.setCacheBlocks(false);
    s.setStartRow("30.0.2.2\01441756800\0");
    s.setStopRow("30.0.2.3\01441756800\0");

    ResultScanner scanner = table.getScanner(s);

    long rows = 0;
    try {
        for (Result rr = scanner.next(); rr != null; rr = scanner.next()) {
            rows++;
        }
    } finally {
        scanner.close();
    }

    System.out.println("Total no of rows = " + rows);
Run Code Online (Sandbox Code Playgroud)

当我使用 cacheRows = 100 或 10000 运行上面的代码时,它会打印 Total no of rows = 480000

当我使用 cacheRows = 100000 运行上面的代码时,它会打印 Total no of rows = 10090

cacheRows = 10083 打印 480000

cacheRows = 10084 打印 191595

cacheRows = 10085 打印 20169

cacheRows = 10086 打印 20170

cacheRows = 10087 打印 20171

cacheRows = 10088 打印 20172

cacheRows = 10089 打印 20173

cacheRows = 10090 打印 20174

cacheRows >= 10091 打印 10090

lav*_*gal 5

通过在 hbase-site.xml 中
设置相同的hbase.server.scanner.max.result.sizehbase.client.scanner.max.result.size

通过在扫描对象值中设置 setMaxResultSize 等于大小 100000(缓存)解决了问题rows 参数)在我的例子中为 20971520 (20MB) 的行

请参阅错误以获取更多详细信息:HBASE-13527