diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java index bfbb8fdd841..1f35d033403 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java @@ -1189,7 +1189,7 @@ public final class BackupSystemTable implements Closeable { List list = new ArrayList<>(); try (Table table = connection.getTable(tableName)) { Scan scan = createScanForBackupSetList(); - scan.setMaxVersions(1); + scan.readVersions(1); try (ResultScanner scanner = table.getScanner(scan)) { Result res; while ((res = scanner.next()) != null) { @@ -1504,7 +1504,7 @@ public final class BackupSystemTable implements Closeable { scan.withStartRow(startRow); scan.setStopRow(stopRow); scan.addFamily(BackupSystemTable.SESSIONS_FAMILY); - scan.setMaxVersions(1); + scan.readVersions(1); return scan; } @@ -1585,7 +1585,7 @@ public final class BackupSystemTable implements Closeable { scan.withStartRow(startRow); scan.setStopRow(stopRow); scan.addFamily(BackupSystemTable.META_FAMILY); - scan.setMaxVersions(1); + scan.readVersions(1); return scan; } @@ -1859,7 +1859,7 @@ public final class BackupSystemTable implements Closeable { scan.withStartRow(startRow); scan.withStopRow(stopRow); scan.addFamily(BackupSystemTable.META_FAMILY); - scan.setMaxVersions(1); + scan.readVersions(1); return scan; } @@ -1894,7 +1894,7 @@ public final class BackupSystemTable implements Closeable { scan.withStartRow(startRow); scan.setStopRow(stopRow); scan.addFamily(BackupSystemTable.META_FAMILY); - scan.setMaxVersions(1); + scan.readVersions(1); return scan; } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java index 6b142c9480a..6288ccfc48d 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java @@ -59,7 +59,7 @@ import org.slf4j.LoggerFactory; * To only retrieve columns with a specific timestamp, call {@link #setTimestamp(long) setTimestamp} * . *

- * To limit the number of versions of each column to be returned, call {@link #setMaxVersions(int)}. + * To limit the number of versions of each column to be returned, call {@link #readVersions(int)}. *

* To limit the maximum number of values returned for each call to next(), call * {@link #setBatch(int) setBatch}. @@ -341,7 +341,7 @@ public class Scan extends Query { * @param minStamp minimum timestamp value, inclusive * @param maxStamp maximum timestamp value, exclusive * @see #readAllVersions() - * @see #setMaxVersions(int) + * @see #readVersions(int) * @return this */ public Scan setTimeRange(long minStamp, long maxStamp) throws IOException { @@ -356,7 +356,7 @@ public class Scan extends Query { * defaut. * @param timestamp version timestamp * @see #readAllVersions() - * @see #setMaxVersions(int) + * @see #readVersions(int) * @return this * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * Use {@link #setTimestamp(long)} instead @@ -374,7 +374,7 @@ public class Scan extends Query { * defaut. * @param timestamp version timestamp * @see #readAllVersions() - * @see #setMaxVersions(int) + * @see #readVersions(int) * @return this */ public Scan setTimestamp(long timestamp) { @@ -516,20 +516,6 @@ public class Scan extends Query { return this; } - /** - * Get up to the specified number of versions of each column. - * @param maxVersions maximum versions for each column - * @return this - * @deprecated since 2.0.0 and will be removed in 3.0.0. It is easy to misunderstand with column - * family's max versions, so use {@link #readVersions(int)} instead. - * @see #readVersions(int) - * @see HBASE-17125 - */ - @Deprecated - public Scan setMaxVersions(int maxVersions) { - return readVersions(maxVersions); - } - /** * Get all available versions. * @return this diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java index 41b4482efd8..7ba7265a8a0 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java @@ -1190,7 +1190,7 @@ public final class ProtobufUtil { scan.setCacheBlocks(proto.getCacheBlocks()); } if (proto.hasMaxVersions()) { - scan.setMaxVersions(proto.getMaxVersions()); + scan.readVersions(proto.getMaxVersions()); } if (proto.hasStoreLimit()) { scan.setMaxResultsPerColumnFamily(proto.getStoreLimit()); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java index c64c7431aa9..578df72bef0 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java @@ -705,7 +705,7 @@ public class IntegrationTestBulkLoad extends IntegrationTestBase { Scan scan = new Scan(); scan.addFamily(CHAIN_FAM); scan.addFamily(SORT_FAM); - scan.setMaxVersions(1); + scan.readVersions(1); scan.setCacheBlocks(false); scan.setBatch(1000); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java index e1ff49c0c21..d15a9d65052 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java @@ -542,7 +542,7 @@ public class IntegrationTestMTTR { s.setBatch(2); s.addFamily(FAMILY); s.setFilter(new KeyOnlyFilter()); - s.setMaxVersions(1); + s.readVersions(1); rs = table.getScanner(s); Result result = rs.next(); diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CellCounter.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CellCounter.java index 62ac905c018..803b65e8f5b 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CellCounter.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CellCounter.java @@ -234,7 +234,7 @@ public class CellCounter extends Configured implements Tool { // Set Scan Versions if (conf.get(TableInputFormat.SCAN_MAXVERSIONS) == null) { // default to all versions unless explicitly set - s.setMaxVersions(Integer.MAX_VALUE); + s.readVersions(Integer.MAX_VALUE); } s.setCacheBlocks(false); // Set RowFilter or Prefix Filter if applicable. diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ExportUtils.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ExportUtils.java index 5ecbaa749af..3683931a9f6 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ExportUtils.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ExportUtils.java @@ -112,7 +112,7 @@ public final class ExportUtils { // Optional arguments. // Set Scan Versions int versions = args.length > 2? Integer.parseInt(args[2]): 1; - s.setMaxVersions(versions); + s.readVersions(versions); // Set Scan Range long startTime = args.length > 3? Long.parseLong(args[3]): 0L; long endTime = args.length > 4? Long.parseLong(args[4]): Long.MAX_VALUE; diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HashTable.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HashTable.java index 3fd93e39191..4f242642c29 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HashTable.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HashTable.java @@ -192,7 +192,7 @@ public class HashTable extends Configured implements Tool { scan.setBatch(scanBatch); } if (versions >= 0) { - scan.setMaxVersions(versions); + scan.readVersions(versions); } if (!isTableStartRow(startRow)) { scan.withStartRow(startRow); diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java index 24b977a941b..29bc0ddf23a 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java @@ -174,7 +174,7 @@ implements Configurable { } if (conf.get(SCAN_MAXVERSIONS) != null) { - scan.setMaxVersions(Integer.parseInt(conf.get(SCAN_MAXVERSIONS))); + scan.readVersions(Integer.parseInt(conf.get(SCAN_MAXVERSIONS))); } if (conf.get(SCAN_CACHEDROWS) != null) { diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java index 14be2dd977b..1edf6ed2573 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java @@ -182,7 +182,7 @@ public class VerifyReplication extends Configured implements Tool { int versions = conf.getInt(NAME+".versions", -1); LOG.info("Setting number of version inside map as: " + versions); if (versions >= 0) { - scan.setMaxVersions(versions); + scan.readVersions(versions); } TableName tableName = TableName.valueOf(conf.get(NAME + ".tableName")); sourceConnection = ConnectionFactory.createConnection(conf); @@ -459,7 +459,7 @@ public class VerifyReplication extends Configured implements Tool { scan.setBatch(batch); } if (versions >= 0) { - scan.setMaxVersions(versions); + scan.readVersions(versions); LOG.info("Number of versions set to " + versions); } if(families != null) { diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/MobRefReporter.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/MobRefReporter.java index 929d64a289b..3256f15839a 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/MobRefReporter.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mob/mapreduce/MobRefReporter.java @@ -459,7 +459,7 @@ public class MobRefReporter extends Configured implements Tool { // a full table scan and don't want to impact other clients badly. scan.setCaching(conf.getInt(HConstants.HBASE_CLIENT_SCANNER_CACHING, 10000)); scan.setCacheBlocks(false); - scan.setMaxVersions(maxVersions); + scan.readVersions(maxVersions); conf.set(REPORT_JOB_ID, id); job = Job.getInstance(conf); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/ScanPerformanceEvaluation.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/ScanPerformanceEvaluation.java index 8b706875e1c..74ee7a6b320 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/ScanPerformanceEvaluation.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/ScanPerformanceEvaluation.java @@ -134,7 +134,7 @@ public class ScanPerformanceEvaluation extends AbstractHBaseTool { private Scan getScan() { Scan scan = new Scan(); // default scan settings scan.setCacheBlocks(false); - scan.setMaxVersions(1); + scan.readVersions(1); scan.setScanMetricsEnabled(true); if (caching != null) { scan.setCaching(Integer.parseInt(caching)); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java index ecef1d73cb7..b5fa1e56345 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java @@ -200,7 +200,7 @@ public class TestTimeRangeMapRed { private void verify(final Table table) throws IOException { Scan scan = new Scan(); scan.addColumn(FAMILY_NAME, COLUMN_NAME); - scan.setMaxVersions(1); + scan.readVersions(1); ResultScanner scanner = table.getScanner(scan); for (Result r: scanner) { for (Cell kv : r.listCells()) { diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java index df4e6adad00..53a59dd6f4e 100644 --- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java +++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java @@ -91,7 +91,7 @@ public class ScannerResultGenerator extends ResultGenerator { } } scan.setTimeRange(rowspec.getStartTime(), rowspec.getEndTime()); - scan.setMaxVersions(rowspec.getMaxVersions()); + scan.readVersions(rowspec.getMaxVersions()); if (filter != null) { scan.setFilter(filter); } diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java index 268f388d358..66487588edd 100644 --- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java +++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java @@ -151,7 +151,7 @@ public class TableResource extends ResourceBase { } Table hTable = RESTServlet.getInstance().getTable(this.table); tableScan.setBatch(batchSize); - tableScan.setMaxVersions(maxVersions); + tableScan.readVersions(maxVersions); tableScan.setTimeRange(startTime, endTime); if (!startRow.isEmpty()) { tableScan.withStartRow(Bytes.toBytes(startRow)); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSerialization.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSerialization.java index fed0623fb42..575d7c402e7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSerialization.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSerialization.java @@ -349,7 +349,7 @@ public class TestSerialization { Scan scan = new Scan(startRow, stopRow); scan.addColumn(fam, qf1); scan.setTimeRange(ts, ts+1); - scan.setMaxVersions(maxVersions); + scan.readVersions(maxVersions); ClientProtos.Scan scanProto = ProtobufUtil.toScan(scan); Scan desScan = ProtobufUtil.toScan(scanProto); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideBase.java index a263ea7e487..4a756b2bff8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideBase.java @@ -586,7 +586,7 @@ class FromClientSideBase { int start, int end) throws IOException { Scan scan = new Scan(row); scan.addColumn(family, qualifier); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); scan.setTimeRange(stamps[start+1], Long.MAX_VALUE); Result result = getSingleScanResult(ht, scan); assertNResult(result, row, family, qualifier, stamps, values, start+1, end); @@ -596,7 +596,7 @@ class FromClientSideBase { byte [] qualifier, long [] stamps, byte [][] values, int start, int end) throws IOException { Scan scan = new Scan(row); scan.addColumn(family, qualifier); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); scan.setTimeRange(stamps[start], stamps[end]+1); Result result = getSingleScanResult(ht, scan); assertNResult(result, row, family, qualifier, stamps, values, start, end); @@ -606,7 +606,7 @@ class FromClientSideBase { byte [] qualifier, long [] stamps, byte [][] values, int start, int end) throws IOException { Scan scan = new Scan(row); scan.addColumn(family, qualifier); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); Result result = getSingleScanResult(ht, scan); assertNResult(result, row, family, qualifier, stamps, values, start, end); } @@ -636,7 +636,7 @@ class FromClientSideBase { Scan scan = new Scan(row); scan.addColumn(family, qualifier); scan.setTimestamp(stamp); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); Result result = getSingleScanResult(ht, scan); assertSingleResult(result, row, family, qualifier, stamp, value); } @@ -646,7 +646,7 @@ class FromClientSideBase { Scan scan = new Scan(row); scan.addColumn(family, qualifier); scan.setTimestamp(stamp); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); Result result = getSingleScanResult(ht, scan); assertNullResult(result); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java index 70e21aeeb54..0350c8b236e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java @@ -1127,7 +1127,7 @@ public class TestFromClientSide extends FromClientSideBase { Scan scan = new Scan(ROW); scan.addColumn(FAMILY, QUALIFIER); - scan.setMaxVersions(2); + scan.readVersions(2); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILY, QUALIFIER, new long[] { STAMPS[4], STAMPS[5] }, new byte[][] { VALUES[4], VALUES[5] }, 0, 1); @@ -1164,7 +1164,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROW); scan.addColumn(FAMILY, QUALIFIER); - scan.setMaxVersions(2); + scan.readVersions(2); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILY, QUALIFIER, new long[] { STAMPS[4], STAMPS[5] }, new byte[][] { VALUES[4], VALUES[5] }, 0, 1); @@ -1258,7 +1258,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROW); scan.addColumn(FAMILY, QUALIFIER); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILY, QUALIFIER, new long[] { STAMPS[3], STAMPS[4], STAMPS[5], STAMPS[6], STAMPS[7], STAMPS[8], STAMPS[9], @@ -1285,7 +1285,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROW); scan.addColumn(FAMILY, QUALIFIER); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILY, QUALIFIER, new long[] { STAMPS[1], STAMPS[2], STAMPS[3], STAMPS[4], STAMPS[5], STAMPS[6], STAMPS[8], @@ -1341,14 +1341,14 @@ public class TestFromClientSide extends FromClientSideBase { Scan scan = new Scan(ROW); scan.addColumn(FAMILIES[0], QUALIFIER); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILIES[0], QUALIFIER, new long[] { STAMPS[1] }, new byte[][] { VALUES[1] }, 0, 0); scan = new Scan(ROW); scan.addFamily(FAMILIES[0]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILIES[0], QUALIFIER, new long[] { STAMPS[1] }, new byte[][] { VALUES[1] }, 0, 0); @@ -1373,7 +1373,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROW); scan.addColumn(FAMILIES[1], QUALIFIER); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILIES[1], QUALIFIER, new long[] { STAMPS[1], STAMPS[2], STAMPS[3] }, @@ -1381,7 +1381,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROW); scan.addFamily(FAMILIES[1]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILIES[1], QUALIFIER, new long[] { STAMPS[1], STAMPS[2], STAMPS[3] }, @@ -1407,7 +1407,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROW); scan.addColumn(FAMILIES[2], QUALIFIER); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILIES[2], QUALIFIER, new long[] { STAMPS[2], STAMPS[3], STAMPS[4], STAMPS[5], STAMPS[6] }, @@ -1415,7 +1415,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROW); scan.addFamily(FAMILIES[2]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILIES[2], QUALIFIER, new long[] { STAMPS[2], STAMPS[3], STAMPS[4], STAMPS[5], STAMPS[6] }, @@ -1445,12 +1445,12 @@ public class TestFromClientSide extends FromClientSideBase { assertEquals("Expected 9 keys but received " + result.size(), 9, result.size()); scan = new Scan(ROW); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertEquals("Expected 9 keys but received " + result.size(), 9, result.size()); scan = new Scan(ROW); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); scan.addFamily(FAMILIES[0]); scan.addFamily(FAMILIES[1]); scan.addFamily(FAMILIES[2]); @@ -1458,7 +1458,7 @@ public class TestFromClientSide extends FromClientSideBase { assertEquals("Expected 9 keys but received " + result.size(), 9, result.size()); scan = new Scan(ROW); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); scan.addColumn(FAMILIES[0], QUALIFIER); scan.addColumn(FAMILIES[1], QUALIFIER); scan.addColumn(FAMILIES[2], QUALIFIER); @@ -1667,7 +1667,7 @@ public class TestFromClientSide extends FromClientSideBase { Scan scan = new Scan(ROW); scan.addFamily(FAMILIES[0]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILIES[0], QUALIFIER, new long[] { ts[1] }, new byte[][] { VALUES[1] }, 0, 0); @@ -1695,7 +1695,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROW); scan.addColumn(FAMILIES[0], QUALIFIER); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILIES[0], QUALIFIER, new long[] { ts[1], ts[2], ts[3] }, new byte[][] { VALUES[1], VALUES[2], VALUES[3] }, 0, 2); @@ -1732,7 +1732,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROW); scan.addFamily(FAMILIES[0]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILIES[0], QUALIFIER, new long[] { ts[1], ts[2], ts[3] }, new byte[][] { VALUES[1], VALUES[2], VALUES[3] }, 0, 2); @@ -1795,7 +1795,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROWS[0]); scan.addFamily(FAMILIES[1]); scan.addFamily(FAMILIES[2]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertEquals("Expected 2 keys but received " + result.size(), 2, result.size()); assertNResult(result, ROWS[0], FAMILIES[1], QUALIFIER, new long[] { ts[0], ts[1] }, @@ -1811,7 +1811,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROWS[1]); scan.addFamily(FAMILIES[1]); scan.addFamily(FAMILIES[2]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertEquals("Expected 2 keys but received " + result.size(), 2, result.size()); @@ -1827,7 +1827,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROWS[2]); scan.addFamily(FAMILIES[1]); scan.addFamily(FAMILIES[2]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertEquals(1, result.size()); assertNResult(result, ROWS[2], FAMILIES[2], QUALIFIER, new long[] { ts[2] }, @@ -1865,7 +1865,7 @@ public class TestFromClientSide extends FromClientSideBase { scan = new Scan(ROWS[3]); scan.addFamily(FAMILIES[1]); scan.addFamily(FAMILIES[2]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); ResultScanner scanner = ht.getScanner(scan); result = scanner.next(); assertEquals("Expected 1 key but received " + result.size(), 1, result.size()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide4.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide4.java index 1849e968c99..229c807cf1b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide4.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide4.java @@ -561,7 +561,7 @@ public class TestFromClientSide4 extends FromClientSideBase { Scan scan = new Scan(ROW); scan.addColumn(FAMILY, QUALIFIER); - scan.setMaxVersions(2); + scan.readVersions(2); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILY, QUALIFIER, new long[] { STAMPS[4], STAMPS[5] }, new byte[][] { VALUES[4], VALUES[5] }, 0, 1); @@ -598,7 +598,7 @@ public class TestFromClientSide4 extends FromClientSideBase { scan = new Scan(ROW); scan.addColumn(FAMILY, QUALIFIER); - scan.setMaxVersions(2); + scan.readVersions(2); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILY, QUALIFIER, new long[] { STAMPS[4], STAMPS[5] }, new byte[][] { VALUES[4], VALUES[5] }, 0, 1); @@ -626,7 +626,7 @@ public class TestFromClientSide4 extends FromClientSideBase { scan = new Scan(ROW); scan.addColumn(FAMILY, QUALIFIER); - scan.setMaxVersions(7); + scan.readVersions(7); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILY, QUALIFIER, new long[] { STAMPS[2], STAMPS[3], STAMPS[4], STAMPS[5], STAMPS[6], STAMPS[7], STAMPS[8] }, @@ -642,7 +642,7 @@ public class TestFromClientSide4 extends FromClientSideBase { VALUES[8] }, 0, 6); scan = new Scan(ROW); - scan.setMaxVersions(7); + scan.readVersions(7); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILY, QUALIFIER, new long[] { STAMPS[2], STAMPS[3], STAMPS[4], STAMPS[5], STAMPS[6], STAMPS[7], STAMPS[8] }, @@ -689,7 +689,7 @@ public class TestFromClientSide4 extends FromClientSideBase { scan = new Scan(ROW); scan.addColumn(FAMILY, QUALIFIER); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILY, QUALIFIER, new long[] { STAMPS[3], STAMPS[4], STAMPS[5], STAMPS[6], STAMPS[7], STAMPS[8], STAMPS[9], @@ -716,7 +716,7 @@ public class TestFromClientSide4 extends FromClientSideBase { scan = new Scan(ROW); scan.addColumn(FAMILY, QUALIFIER); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILY, QUALIFIER, new long[] { STAMPS[1], STAMPS[2], STAMPS[3], STAMPS[4], STAMPS[5], STAMPS[6], STAMPS[8], diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide5.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide5.java index 4205a560dc9..5cb73b9d622 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide5.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide5.java @@ -1465,7 +1465,7 @@ public class TestFromClientSide5 extends FromClientSideBase { // then if we decrease the number of versions, but keep the scan raw, we should see exactly // that number of versions versions = 2; - s.setMaxVersions(versions); + s.readVersions(versions); try (ResultScanner scanner = table.getScanner(s)) { int count = 0; for (Result r : scanner) { @@ -1480,7 +1480,7 @@ public class TestFromClientSide5 extends FromClientSideBase { // finally, if we turn off raw scanning, but max out the number of versions, we should go back // to seeing just three versions = 3; - s.setMaxVersions(versions); + s.readVersions(versions); try (ResultScanner scanner = table.getScanner(s)) { int count = 0; for (Result r : scanner) { @@ -1830,7 +1830,7 @@ public class TestFromClientSide5 extends FromClientSideBase { Scan scan = new Scan(ROW); scan.setReversed(true); scan.addFamily(FAMILIES[0]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); Result result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILIES[0], QUALIFIER, new long[]{ts[1]}, new byte[][]{VALUES[1]}, 0, 0); @@ -1852,7 +1852,7 @@ public class TestFromClientSide5 extends FromClientSideBase { scan = new Scan(ROW); scan.setReversed(true); scan.addColumn(FAMILIES[0], QUALIFIER); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILIES[0], QUALIFIER, new long[]{ts[1], ts[2], ts[3]}, new byte[][]{VALUES[1], VALUES[2], VALUES[3]}, 0, 2); @@ -1881,7 +1881,7 @@ public class TestFromClientSide5 extends FromClientSideBase { scan = new Scan(ROW); scan.setReversed(true); scan.addFamily(FAMILIES[0]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertNResult(result, ROW, FAMILIES[0], QUALIFIER, new long[]{ts[1], ts[2], ts[3]}, new byte[][]{VALUES[1], VALUES[2], VALUES[3]}, 0, 2); @@ -1928,7 +1928,7 @@ public class TestFromClientSide5 extends FromClientSideBase { scan.setReversed(true); scan.addFamily(FAMILIES[1]); scan.addFamily(FAMILIES[2]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertEquals("Expected 2 keys but received " + result.size(), 2, result.size()); assertNResult(result, ROWS[0], FAMILIES[1], QUALIFIER, new long[]{ts[0], @@ -1938,7 +1938,7 @@ public class TestFromClientSide5 extends FromClientSideBase { scan.setReversed(true); scan.addFamily(FAMILIES[1]); scan.addFamily(FAMILIES[2]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertEquals("Expected 2 keys but received " + result.size(), 2, result.size()); @@ -1946,7 +1946,7 @@ public class TestFromClientSide5 extends FromClientSideBase { scan.setReversed(true); scan.addFamily(FAMILIES[1]); scan.addFamily(FAMILIES[2]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); result = getSingleScanResult(ht, scan); assertEquals(1, result.size()); assertNResult(result, ROWS[2], FAMILIES[2], QUALIFIER, @@ -1971,7 +1971,7 @@ public class TestFromClientSide5 extends FromClientSideBase { scan.setReversed(true); scan.addFamily(FAMILIES[1]); scan.addFamily(FAMILIES[2]); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); ResultScanner scanner = ht.getScanner(scan); result = scanner.next(); assertEquals("Expected 2 keys but received " + result.size(), 2, result.size()); @@ -2399,7 +2399,7 @@ public class TestFromClientSide5 extends FromClientSideBase { Scan scan = new Scan().setFilter(new ValueFilter(CompareOperator.EQUAL, new SubstringComparator("value-a"))) - .setMaxVersions(3); + .readVersions(3); ResultScanner scanner = table.getScanner(scan); Result result = scanner.next(); // ts[0] has gone from user view. Only read ts[2] which value is less or equal to 3 @@ -2420,7 +2420,7 @@ public class TestFromClientSide5 extends FromClientSideBase { scan = new Scan().setFilter(new ValueFilter(CompareOperator.EQUAL, new SubstringComparator("value-a"))) - .setMaxVersions(1); + .readVersions(1); scanner = table.getScanner(scan); result = scanner.next(); // ts[0] has gone from user view. Only read ts[2] which value is less or equal to 3 @@ -2442,7 +2442,7 @@ public class TestFromClientSide5 extends FromClientSideBase { scan = new Scan().setFilter(new ValueFilter(CompareOperator.EQUAL, new SubstringComparator("value-a"))) - .setMaxVersions(5); + .readVersions(5); scanner = table.getScanner(scan); result = scanner.next(); // ts[0] has gone from user view. Only read ts[2] which value is less or equal to 3 diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java index 97188abe556..c68a25cbc83 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultipleTimestamps.java @@ -195,7 +195,7 @@ public class TestMultipleTimestamps { TEST_UTIL.flush(tableName); Scan scan = new Scan(); - scan.setMaxVersions(10); + scan.readVersions(10); ResultScanner scanner = ht.getScanner(scan); while (true) { Result r = scanner.next(); @@ -460,7 +460,7 @@ public class TestMultipleTimestamps { byte column[] = Bytes.toBytes("column:" + colIdx); scan.addColumn(cf, column); } - scan.setMaxVersions(maxVersions); + scan.readVersions(maxVersions); scan.setTimeRange(Collections.min(Arrays.asList(versions)), Collections.max(Arrays.asList(versions))+1); ResultScanner scanner = ht.getScanner(scan); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java index 715c15d3051..2caf3768472 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestOpenTableInCoprocessor.java @@ -203,7 +203,7 @@ public class TestOpenTableInCoprocessor { */ private int getKeyValueCount(Table table) throws IOException { Scan scan = new Scan(); - scan.setMaxVersions(Integer.MAX_VALUE - 1); + scan.readVersions(Integer.MAX_VALUE - 1); ResultScanner results = table.getScanner(scan); int count = 0; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java index a7fa823c475..de0af15f84e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestDependentColumnFilter.java @@ -187,7 +187,7 @@ public class TestDependentColumnFilter { Scan scan = new Scan(); scan.setFilter(filter); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); verifyScan(scan, 2, 8); @@ -195,7 +195,7 @@ public class TestDependentColumnFilter { filter = new DependentColumnFilter(FAMILIES[0], QUALIFIER, true); scan = new Scan(); scan.setFilter(filter); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); verifyScan(scan, 2, 3); @@ -204,7 +204,7 @@ public class TestDependentColumnFilter { CompareOperator.EQUAL, new BinaryComparator(MATCH_VAL)); scan = new Scan(); scan.setFilter(filter); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); /* * expecting to get the following 3 cells @@ -221,7 +221,7 @@ public class TestDependentColumnFilter { CompareOperator.EQUAL, new BinaryComparator(MATCH_VAL)); scan = new Scan(); scan.setFilter(filter); - scan.setMaxVersions(Integer.MAX_VALUE); + scan.readVersions(Integer.MAX_VALUE); /* * expecting to get the following 1 cell diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java index b2e08be353f..1fa0a684030 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java @@ -122,7 +122,7 @@ public class TestDefaultMobStoreFlusher { //Scan Scan scan = new Scan(); scan.addColumn(family, qf1); - scan.setMaxVersions(4); + scan.readVersions(4); ResultScanner scanner = table.getScanner(scan); //Compare diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java index 95038f5a90d..2b1595d4a13 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobDataBlockEncoding.java @@ -120,7 +120,7 @@ public class TestMobDataBlockEncoding { admin.flush(TableName.valueOf(TN)); Scan scan = new Scan(); - scan.setMaxVersions(4); + scan.readVersions(4); MobTestUtil.assertCellsValue(table, scan, value, 3); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreScanner.java index 2040a0d4d27..c787a64a46f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobStoreScanner.java @@ -131,7 +131,7 @@ public class TestMobStoreScanner { */ public void setScan(Scan scan, boolean reversed, boolean mobScanRaw) { scan.setReversed(reversed); - scan.setMaxVersions(4); + scan.readVersions(4); if(mobScanRaw) { scan.setAttribute(MobConstants.MOB_SCAN_RAW, Bytes.toBytes(Boolean.TRUE)); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java index 4f845bc06a9..51fba2d44c3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java @@ -122,7 +122,7 @@ public class TestBlocksScanned { Scan scan = new Scan().withStartRow(Bytes.toBytes("aaa")).withStopRow(Bytes.toBytes("aaz")) .setReadType(Scan.ReadType.PREAD); scan.addColumn(FAMILY, COL); - scan.setMaxVersions(1); + scan.readVersions(1); InternalScanner s = r.getScanner(scan); List results = new ArrayList<>(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java index 8ac70a027e0..dad6d3c2816 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java @@ -612,7 +612,7 @@ public class TestHRegion { region.flush(true); Scan scan = new Scan(); - scan.setMaxVersions(3); + scan.readVersions(3); // open the first scanner RegionScanner scanner1 = region.getScanner(scan); @@ -663,7 +663,7 @@ public class TestHRegion { region.flush(true); Scan scan = new Scan(); - scan.setMaxVersions(3); + scan.readVersions(3); // open the first scanner RegionScanner scanner1 = region.getScanner(scan); @@ -3142,7 +3142,7 @@ public class TestHRegion { Scan scan = new Scan(row1); scan.addColumn(fam1, qf1); - scan.setMaxVersions(MAX_VERSIONS); + scan.readVersions(MAX_VERSIONS); List actual = new ArrayList<>(); InternalScanner scanner = region.getScanner(scan); @@ -3199,7 +3199,7 @@ public class TestHRegion { Scan scan = new Scan(row1); scan.addColumn(fam1, qf1); scan.addColumn(fam1, qf2); - scan.setMaxVersions(MAX_VERSIONS); + scan.readVersions(MAX_VERSIONS); List actual = new ArrayList<>(); InternalScanner scanner = region.getScanner(scan); @@ -3276,7 +3276,7 @@ public class TestHRegion { scan.addColumn(fam1, qf1); scan.addColumn(fam1, qf2); int versions = 3; - scan.setMaxVersions(versions); + scan.readVersions(versions); List actual = new ArrayList<>(); InternalScanner scanner = region.getScanner(scan); @@ -3331,7 +3331,7 @@ public class TestHRegion { Scan scan = new Scan(row1); scan.addFamily(fam1); - scan.setMaxVersions(MAX_VERSIONS); + scan.readVersions(MAX_VERSIONS); List actual = new ArrayList<>(); InternalScanner scanner = region.getScanner(scan); @@ -3386,7 +3386,7 @@ public class TestHRegion { Scan scan = new Scan(row1); scan.addFamily(fam1); - scan.setMaxVersions(MAX_VERSIONS); + scan.readVersions(MAX_VERSIONS); List actual = new ArrayList<>(); InternalScanner scanner = region.getScanner(scan); @@ -3502,7 +3502,7 @@ public class TestHRegion { Scan scan = new Scan(row1); int versions = 3; - scan.setMaxVersions(versions); + scan.readVersions(versions); List actual = new ArrayList<>(); InternalScanner scanner = region.getScanner(scan); @@ -5218,7 +5218,7 @@ public class TestHRegion { region.put(put); Scan scan = new Scan(rowC); - scan.setMaxVersions(5); + scan.readVersions(5); scan.setReversed(true); InternalScanner scanner = region.getScanner(scan); List currRow = new ArrayList<>(); @@ -5274,7 +5274,7 @@ public class TestHRegion { Scan scan = new Scan(rowD); List currRow = new ArrayList<>(); scan.setReversed(true); - scan.setMaxVersions(5); + scan.readVersions(5); InternalScanner scanner = region.getScanner(scan); boolean hasNext = scanner.next(currRow); assertEquals(2, currRow.size()); @@ -5604,7 +5604,7 @@ public class TestHRegion { region.put(put); // scan range = ["row4", min), skip the max "row5" Scan scan = new Scan(row4); - scan.setMaxVersions(5); + scan.readVersions(5); scan.setBatch(3); scan.setReversed(true); InternalScanner scanner = region.getScanner(scan); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java index dcad173fa34..6ad646b3572 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java @@ -956,7 +956,7 @@ public class TestKeepDeletes { Scan s = new Scan(); s.setRaw(true); // use max versions from the store(s) - s.setMaxVersions(region.getStores().iterator().next().getScanInfo().getMaxVersions()); + s.readVersions(region.getStores().iterator().next().getScanInfo().getMaxVersions()); InternalScanner scan = region.getScanner(s); List kvs = new ArrayList<>(); int res = 0; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java index aeeaf3d1d8e..af4bdc75d0f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java @@ -311,7 +311,7 @@ public class TestScannerWithBulkload { private Scan createScan() { Scan scan = new Scan(); - scan.setMaxVersions(3); + scan.readVersions(3); return scan; } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java index 33fd0f533dd..7eb7fcf963f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java @@ -214,7 +214,7 @@ public class TestSeekOptimizations { scan.addColumn(FAMILY_BYTES, Bytes.toBytes(qualStr)); qualSet.add(qualStr); } - scan.setMaxVersions(maxVersions); + scan.readVersions(maxVersions); scan.withStartRow(rowBytes(startRow)); // Adjust for the fact that for multi-row queries the end row is exclusive. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java index 46ede588892..bc1ea584050 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java @@ -105,7 +105,7 @@ public class TestWideScanner extends HBaseTestCase { scan.addFamily(A); scan.addFamily(B); scan.addFamily(C); - scan.setMaxVersions(100); + scan.readVersions(100); scan.setBatch(batch); InternalScanner s = r.getScanner(scan); int total = 0; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java index 213c1e2803b..3a87f07655d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java @@ -750,7 +750,7 @@ public abstract class TestVisibilityLabels { table.put(put); Scan s = new Scan(); - s.setMaxVersions(1); + s.readVersions(1); s.setAuthorizations(new Authorizations(SECRET)); ResultScanner scanner = table.getScanner(s); Result result = scanner.next(); diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java index 78260b69c8f..1ac29f3933a 100644 --- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java +++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java @@ -530,7 +530,7 @@ public final class ThriftUtilities { out.setCaching(in.getCaching()); } if (in.isSetMaxVersions()) { - out.setMaxVersions(in.getMaxVersions()); + out.readVersions(in.getMaxVersions()); } if (in.isSetColumns()) { diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftConnection.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftConnection.java index f04bffe4d1b..13983bdfd72 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftConnection.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftConnection.java @@ -740,7 +740,7 @@ public class TestThriftConnection { filterList.addFilter(prefixFilter); filterList.addFilter(columnValueFilter); Scan scan = new Scan(); - scan.setMaxVersions(2); + scan.readVersions(2); scan.setFilter(filterList); ResultScanner scanner = table.getScanner(scan); Iterator iterator = scanner.iterator();