Skip to content

Commit 2c7fdb3

Browse files
committed
HBASE-22277 Removed deprecated methods from Get
1 parent 70296a2 commit 2c7fdb3

File tree

26 files changed

+144
-200
lines changed

26 files changed

+144
-200
lines changed

hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ private Put createPutForBackupInfo(BackupInfo context) throws IOException {
14051405
private Get createGetForBackupInfo(String backupId) throws IOException {
14061406
Get get = new Get(rowkey(BACKUP_INFO_PREFIX, backupId));
14071407
get.addFamily(BackupSystemTable.SESSIONS_FAMILY);
1408-
get.setMaxVersions(1);
1408+
get.readVersions(1);
14091409
return get;
14101410
}
14111411

@@ -1440,7 +1440,7 @@ private BackupInfo resultToBackupInfo(Result res) throws IOException {
14401440
private Get createGetForStartCode(String rootPath) throws IOException {
14411441
Get get = new Get(rowkey(START_CODE_ROW, rootPath));
14421442
get.addFamily(BackupSystemTable.META_FAMILY);
1443-
get.setMaxVersions(1);
1443+
get.readVersions(1);
14441444
return get;
14451445
}
14461446

@@ -1463,7 +1463,7 @@ private Put createPutForStartCode(String startCode, String rootPath) {
14631463
private Get createGetForIncrBackupTableSet(String backupRoot) throws IOException {
14641464
Get get = new Get(rowkey(INCR_BACKUP_SET, backupRoot));
14651465
get.addFamily(BackupSystemTable.META_FAMILY);
1466-
get.setMaxVersions(1);
1466+
get.readVersions(1);
14671467
return get;
14681468
}
14691469

hbase-client/src/main/java/org/apache/hadoop/hbase/client/Get.java

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
* {@link #setTimestamp(long) setTimestamp}.
6060
* <p>
6161
* To limit the number of versions of each column to be returned, execute
62-
* {@link #setMaxVersions(int) setMaxVersions}.
62+
* {@link #readVersions(int) readVersions}.
6363
* <p>
6464
* To add a filter, call {@link #setFilter(Filter) setFilter}.
6565
*/
@@ -160,26 +160,6 @@ public Get setCheckExistenceOnly(boolean checkExistenceOnly) {
160160
return this;
161161
}
162162

163-
/**
164-
* This will always return the default value which is false as client cannot set the value to this
165-
* property any more.
166-
* @deprecated since 2.0.0 and will be removed in 3.0.0
167-
*/
168-
@Deprecated
169-
public boolean isClosestRowBefore() {
170-
return closestRowBefore;
171-
}
172-
173-
/**
174-
* This is not used any more and does nothing. Use reverse scan instead.
175-
* @deprecated since 2.0.0 and will be removed in 3.0.0
176-
*/
177-
@Deprecated
178-
public Get setClosestRowBefore(boolean closestRowBefore) {
179-
// do Nothing
180-
return this;
181-
}
182-
183163
/**
184164
* Get all columns from the specified family.
185165
* <p>
@@ -227,18 +207,6 @@ public Get setTimeRange(long minStamp, long maxStamp) throws IOException {
227207
return this;
228208
}
229209

230-
/**
231-
* Get versions of columns with the specified timestamp.
232-
* @param timestamp version timestamp
233-
* @return this for invocation chaining
234-
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
235-
* Use {@link #setTimestamp(long)} instead
236-
*/
237-
@Deprecated
238-
public Get setTimeStamp(long timestamp) throws IOException {
239-
return this.setTimestamp(timestamp);
240-
}
241-
242210
/**
243211
* Get versions of columns with the specified timestamp.
244212
* @param timestamp version timestamp
@@ -260,30 +228,6 @@ public Get setTimestamp(long timestamp) {
260228
return (Get) super.setColumnFamilyTimeRange(cf, minStamp, maxStamp);
261229
}
262230

263-
/**
264-
* Get all available versions.
265-
* @return this for invocation chaining
266-
* @deprecated It is easy to misunderstand with column family's max versions, so use
267-
* {@link #readAllVersions()} instead.
268-
*/
269-
@Deprecated
270-
public Get setMaxVersions() {
271-
return readAllVersions();
272-
}
273-
274-
/**
275-
* Get up to the specified number of versions of each column.
276-
* @param maxVersions maximum versions for each column
277-
* @throws IOException if invalid number of versions
278-
* @return this for invocation chaining
279-
* @deprecated It is easy to misunderstand with column family's max versions, so use
280-
* {@link #readVersions(int)} instead.
281-
*/
282-
@Deprecated
283-
public Get setMaxVersions(int maxVersions) throws IOException {
284-
return readVersions(maxVersions);
285-
}
286-
287231
/**
288232
* Get all available versions.
289233
* @return this for invocation chaining

hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ public static Get toGet(final ClientProtos.Get proto) throws IOException {
381381
get.setCacheBlocks(proto.getCacheBlocks());
382382
}
383383
if (proto.hasMaxVersions()) {
384-
get.setMaxVersions(proto.getMaxVersions());
384+
get.readVersions(proto.getMaxVersions());
385385
}
386386
if (proto.hasStoreLimit()) {
387387
get.setMaxResultsPerColumnFamily(proto.getStoreLimit());

hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ public static Get toGet(final ClientProtos.Get proto) throws IOException {
524524
get.setCacheBlocks(proto.getCacheBlocks());
525525
}
526526
if (proto.hasMaxVersions()) {
527-
get.setMaxVersions(proto.getMaxVersions());
527+
get.readVersions(proto.getMaxVersions());
528528
}
529529
if (proto.hasStoreLimit()) {
530530
get.setMaxResultsPerColumnFamily(proto.getStoreLimit());

hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public void TestGetRowFromGetCopyConstructor() throws Exception {
175175
get.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED);
176176
get.setCheckExistenceOnly(true);
177177
get.setTimeRange(3, 4);
178-
get.setMaxVersions(11);
178+
get.readVersions(11);
179179
get.setMaxResultsPerColumnFamily(10);
180180
get.setRowOffsetPerColumnFamily(11);
181181
get.setCacheBlocks(true);

hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestScan.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void testGetToScan() throws Exception {
7878
.setIsolationLevel(IsolationLevel.READ_COMMITTED)
7979
.setLoadColumnFamiliesOnDemand(false)
8080
.setMaxResultsPerColumnFamily(1000)
81-
.setMaxVersions(9999)
81+
.readVersions(9999)
8282
.setRowOffsetPerColumnFamily(5)
8383
.setTimeRange(0, 13)
8484
.setAttribute("att_v0", Bytes.toBytes("att_v0"))

hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ public void testSimpleCase() throws Throwable {
228228
assertTrue(runImport(args));
229229

230230
Get g = new Get(ROW1);
231-
g.setMaxVersions();
231+
g.readAllVersions();
232232
Result r = t.get(g);
233233
assertEquals(3, r.size());
234234
g = new Get(ROW2);
235-
g.setMaxVersions();
235+
g.readAllVersions();
236236
r = t.get(g);
237237
assertEquals(3, r.size());
238238
g = new Get(ROW3);

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public RowResultGenerator(final String tableName, final RowSpec rowspec,
6262
}
6363
}
6464
get.setTimeRange(rowspec.getStartTime(), rowspec.getEndTime());
65-
get.setMaxVersions(rowspec.getMaxVersions());
65+
get.readVersions(rowspec.getMaxVersions());
6666
if (filter != null) {
6767
get.setFilter(filter);
6868
}

hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public void testGet() throws IOException {
249249

250250
get = new Get(ROW_2);
251251
get.addFamily(COLUMN_1);
252-
get.setMaxVersions(2);
252+
get.readVersions(2);
253253
result = remoteTable.get(get);
254254
int count = 0;
255255
for (Cell kv: result.listCells()) {
@@ -279,7 +279,7 @@ public void testMultiGet() throws Exception {
279279
//Test Versions
280280
gets = new ArrayList<>(2);
281281
Get g = new Get(ROW_1);
282-
g.setMaxVersions(3);
282+
g.readVersions(3);
283283
gets.add(g);
284284
gets.add(new Get(ROW_2));
285285
results = remoteTable.get(gets);

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3087,7 +3087,7 @@ public void prepareDeleteTimestamps(Mutation mutation, Map<byte[], List<Cell>> f
30873087
count = kvCount.get(qual);
30883088

30893089
Get get = new Get(CellUtil.cloneRow(cell));
3090-
get.setMaxVersions(count);
3090+
get.readVersions(count);
30913091
get.addColumn(family, qual);
30923092
if (coprocessorHost != null) {
30933093
if (!coprocessorHost.prePrepareTimeStampForDeleteVersion(mutation, cell,

0 commit comments

Comments
 (0)