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);
當運行上面cacheRows = 100或10000碼它打印 總計沒有行= 480000HBASE掃描scan.setCaching設置heigher值時不返回的所有行(cacheRow)
當我運行的上面cacheRows = 100000它打印 總代碼沒有行的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