nyl3532016 commented on a change in pull request #1724:
URL: https://github.com/apache/hbase/pull/1724#discussion_r426400166
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java
##########
@@ -190,6 +195,36 @@ public void testNoDuplicateResultsWhenSplitting() throws
Exception {
}
}
+
+ @Test
+ public void testScanLimit() throws Exception {
+ setupCluster();
+ final TableName tableName = TableName.valueOf(name.getMethodName());
+ final String snapshotName = tableName + "Snapshot";
+ try {
+ createTableAndSnapshot(UTIL, tableName, snapshotName, 50);
+ Path restoreDir = UTIL.getDataTestDirOnTestFS(snapshotName);
+ Scan scan = new Scan().withStartRow(bbb).setLimit(100); // limit the scan
+
+ TableSnapshotScanner scanner =
+ new TableSnapshotScanner(UTIL.getConfiguration(), restoreDir,
snapshotName, scan);
+ int count = 0;
+ while (true) {
+ Result result = scanner.next();
+ if (result == null) {
+ break;
+ }
+ count++;
+ }
+ Assert.assertEquals(100, count);
+ scanner.close();
Review comment:
yes,You are quite right
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]