Skip to content

Commit 5da5deb

Browse files
authored
HBASE-22344 Documented the deprecation of public and limited private APIs (#208)
Signed-off-by: stack <stack@apache.org>
1 parent 214553d commit 5da5deb

31 files changed

Lines changed: 332 additions & 91 deletions

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ protected HColumnDescriptor(ModifyableColumnFamilyDescriptor delegate) {
162162
* name: i.e. 'printable' and ends in a ':' (Null passes are allowed because
163163
* <code>b</code> can be null when deserializing). Cannot start with a '.'
164164
* either. Also Family can not be an empty value or equal "recovered.edits".
165-
* @deprecated Use {@link ColumnFamilyDescriptorBuilder#isLegalColumnFamilyName(byte[])}.
165+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use
166+
* {@link ColumnFamilyDescriptorBuilder#isLegalColumnFamilyName(byte[])} instead.
167+
* @see ColumnFamilyDescriptorBuilder#isLegalColumnFamilyName(byte[])
168+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-18008">HBASE-18008</a>
166169
*/
167170
@Deprecated
168171
public static byte [] isLegalFamilyName(final byte [] b) {

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

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,11 @@ public int compareTo(final HTableDescriptor other) {
598598
/**
599599
* Returns an unmodifiable collection of all the {@link HColumnDescriptor}
600600
* of all the column families of the table.
601-
* @deprecated Use {@link #getColumnFamilies}.
601+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use {@link #getColumnFamilies()} instead.
602602
* @return Immutable collection of {@link HColumnDescriptor} of all the
603603
* column families.
604+
* @see #getColumnFamilies()
605+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-18008">HBASE-18008</a>
604606
*/
605607
@Deprecated
606608
public Collection<HColumnDescriptor> getFamilies() {
@@ -707,8 +709,9 @@ public int getColumnFamilyCount() {
707709
* of the table.
708710
*
709711
* @return Array of all the HColumnDescriptors of the current table
710-
*
712+
* @deprecated since 2.0.0 and will be removed in 3.0.0.
711713
* @see #getFamilies()
714+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-18008">HBASE-18008</a>
712715
*/
713716
@Deprecated
714717
@Override
@@ -724,7 +727,10 @@ public HColumnDescriptor[] getColumnFamilies() {
724727
* @param column Column family name
725728
* @return Column descriptor for the passed family name or the family on
726729
* passed in column.
727-
* @deprecated Use {@link #getColumnFamily(byte[])}.
730+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use {@link #getColumnFamily(byte[])}
731+
* instead.
732+
* @see #getColumnFamily(byte[])
733+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-18008">HBASE-18008</a>
728734
*/
729735
@Deprecated
730736
public HColumnDescriptor getFamily(final byte[] column) {
@@ -857,19 +863,31 @@ public void removeCoprocessor(String className) {
857863
public static final HTableDescriptor NAMESPACE_TABLEDESC
858864
= new HTableDescriptor(TableDescriptorBuilder.NAMESPACE_TABLEDESC);
859865

866+
/**
867+
* @deprecated since 0.94.1
868+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-6188">HBASE-6188</a>
869+
*/
860870
@Deprecated
861871
public HTableDescriptor setOwner(User owner) {
862872
getDelegateeForModification().setOwner(owner);
863873
return this;
864874
}
865875

876+
/**
877+
* @deprecated since 0.94.1
878+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-6188">HBASE-6188</a>
879+
*/
866880
// used by admin.rb:alter(table_name,*args) to update owner.
867881
@Deprecated
868882
public HTableDescriptor setOwnerString(String ownerString) {
869883
getDelegateeForModification().setOwnerString(ownerString);
870884
return this;
871885
}
872886

887+
/**
888+
* @deprecated since 0.94.1
889+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-6188">HBASE-6188</a>
890+
*/
873891
@Override
874892
@Deprecated
875893
public String getOwnerString() {

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,10 @@ Map<ServerName, Boolean> compactionSwitch(boolean switchState, List<String> serv
708708
* array we'll assign to a random server. A server name is made of host, port and
709709
* startcode. Here is an example: <code> host187.example.com,60020,1289493121758</code>
710710
* @throws IOException if we can't find a region named <code>encodedRegionName</code>
711-
* @deprecated Use {@link #move(byte[], ServerName)} instead. And if you want to move the region
712-
* to a random server, please use {@link #move(byte[])}.
711+
* @deprecated since 2.2.0 and will be removed in 4.0.0. Use {@link #move(byte[], ServerName)}
712+
* instead. And if you want to move the region to a random server, please use
713+
* {@link #move(byte[])}.
714+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-22108">HBASE-22108</a>
713715
*/
714716
@Deprecated
715717
default void move(byte[] encodedRegionName, byte[] destServerName) throws IOException {
@@ -1213,7 +1215,8 @@ List<TableDescriptor> listTableDescriptors(List<TableName> tableNames)
12131215
* @return <code>true</code> if aborted, <code>false</code> if procedure already completed or does
12141216
* not exist
12151217
* @throws IOException if a remote or network exception occurs
1216-
* @deprecated Since 2.1.1 -- to be removed.
1218+
* @deprecated since 2.1.1 and will be removed in 4.0.0.
1219+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-21223">HBASE-21223</a>
12171220
*/
12181221
@Deprecated
12191222
default boolean abortProcedure(long procId, boolean mayInterruptIfRunning) throws IOException {
@@ -1233,7 +1236,8 @@ default boolean abortProcedure(long procId, boolean mayInterruptIfRunning) throw
12331236
* @param mayInterruptIfRunning if the proc completed at least one step, should it be aborted?
12341237
* @return <code>true</code> if aborted, <code>false</code> if procedure already completed or does not exist
12351238
* @throws IOException if a remote or network exception occurs
1236-
* @deprecated Since 2.1.1 -- to be removed.
1239+
* @deprecated since 2.1.1 and will be removed in 4.0.0.
1240+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-21223">HBASE-21223</a>
12371241
*/
12381242
@Deprecated
12391243
Future<Boolean> abortProcedureAsync(long procId, boolean mayInterruptIfRunning)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,8 @@ CompletableFuture<Boolean> isProcedureFinished(String signature, String instance
976976
* @param mayInterruptIfRunning if the proc completed at least one step, should it be aborted?
977977
* @return true if aborted, false if procedure already completed or does not exist. the value is
978978
* wrapped by {@link CompletableFuture}
979-
* @deprecated Since 2.1.1 -- to be removed.
979+
* @deprecated since 2.1.1 and will be removed in 4.0.0.
980+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-21223">HBASE-21223</a>
980981
*/
981982
@Deprecated
982983
CompletableFuture<Boolean> abortProcedure(long procId, boolean mayInterruptIfRunning);

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

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ public class Scan extends Query {
182182
public Scan() {}
183183

184184
/**
185-
* @deprecated use {@code new Scan().withStartRow(startRow).setFilter(filter)} instead.
185+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use
186+
* {@code new Scan().withStartRow(startRow).setFilter(filter)} instead.
187+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-17320">HBASE-17320</a>
186188
*/
187189
@Deprecated
188190
public Scan(byte[] startRow, Filter filter) {
@@ -196,7 +198,9 @@ public Scan(byte[] startRow, Filter filter) {
196198
* If the specified row does not exist, the Scanner will start from the next closest row after the
197199
* specified row.
198200
* @param startRow row to start scanner at or after
199-
* @deprecated use {@code new Scan().withStartRow(startRow)} instead.
201+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use
202+
* {@code new Scan().withStartRow(startRow)} instead.
203+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-17320">HBASE-17320</a>
200204
*/
201205
@Deprecated
202206
public Scan(byte[] startRow) {
@@ -207,7 +211,9 @@ public Scan(byte[] startRow) {
207211
* Create a Scan operation for the range of rows specified.
208212
* @param startRow row to start scanner at or after (inclusive)
209213
* @param stopRow row to stop scanner before (exclusive)
210-
* @deprecated use {@code new Scan().withStartRow(startRow).withStopRow(stopRow)} instead.
214+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use
215+
* {@code new Scan().withStartRow(startRow).withStopRow(stopRow)} instead.
216+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-17320">HBASE-17320</a>
211217
*/
212218
@Deprecated
213219
public Scan(byte[] startRow, byte[] stopRow) {
@@ -409,8 +415,11 @@ public Scan setTimestamp(long timestamp) {
409415
* @return this
410416
* @throws IllegalArgumentException if startRow does not meet criteria for a row key (when length
411417
* exceeds {@link HConstants#MAX_ROW_LENGTH})
412-
* @deprecated use {@link #withStartRow(byte[])} instead. This method may change the inclusive of
413-
* the stop row to keep compatible with the old behavior.
418+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use {@link #withStartRow(byte[])}
419+
* instead. This method may change the inclusive of the stop row to keep compatible with the old
420+
* behavior.
421+
* @see #withStartRow(byte[])
422+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-17320">HBASE-17320</a>
414423
*/
415424
@Deprecated
416425
public Scan setStartRow(byte[] startRow) {
@@ -469,8 +478,11 @@ public Scan withStartRow(byte[] startRow, boolean inclusive) {
469478
* @return this
470479
* @throws IllegalArgumentException if stopRow does not meet criteria for a row key (when length
471480
* exceeds {@link HConstants#MAX_ROW_LENGTH})
472-
* @deprecated use {@link #withStopRow(byte[])} instead. This method may change the inclusive of
473-
* the stop row to keep compatible with the old behavior.
481+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use {@link #withStopRow(byte[])} instead.
482+
* This method may change the inclusive of the stop row to keep compatible with the old
483+
* behavior.
484+
* @see #withStopRow(byte[])
485+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-17320">HBASE-17320</a>
474486
*/
475487
@Deprecated
476488
public Scan setStopRow(byte[] stopRow) {
@@ -587,8 +599,10 @@ private byte[] calculateTheClosestNextRowKeyForPrefix(byte[] rowKeyPrefix) {
587599
/**
588600
* Get all available versions.
589601
* @return this
590-
* @deprecated It is easy to misunderstand with column family's max versions, so use
591-
* {@link #readAllVersions()} instead.
602+
* @deprecated since 2.0.0 and will be removed in 3.0.0. It is easy to misunderstand with column
603+
* family's max versions, so use {@link #readAllVersions()} instead.
604+
* @see #readAllVersions()
605+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-17125">HBASE-17125</a>
592606
*/
593607
@Deprecated
594608
public Scan setMaxVersions() {
@@ -599,8 +613,10 @@ public Scan setMaxVersions() {
599613
* Get up to the specified number of versions of each column.
600614
* @param maxVersions maximum versions for each column
601615
* @return this
602-
* @deprecated It is easy to misunderstand with column family's max versions, so use
603-
* {@link #readVersions(int)} instead.
616+
* @deprecated since 2.0.0 and will be removed in 3.0.0. It is easy to misunderstand with column
617+
* family's max versions, so use {@link #readVersions(int)} instead.
618+
* @see #readVersions(int)
619+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-17125">HBASE-17125</a>
604620
*/
605621
@Deprecated
606622
public Scan setMaxVersions(int maxVersions) {
@@ -1023,12 +1039,13 @@ public boolean isRaw() {
10231039
* better performance for small scan. [HBASE-9488]. Generally, if the scan range is within one
10241040
* data block(64KB), it could be considered as a small scan.
10251041
* @param small
1026-
* @deprecated since 2.0.0. Use {@link #setLimit(int)} and {@link #setReadType(ReadType)} instead.
1027-
* And for the one rpc optimization, now we will also fetch data when openScanner, and
1028-
* if the number of rows reaches the limit then we will close the scanner
1029-
* automatically which means we will fall back to one rpc.
1042+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use {@link #setLimit(int)} and
1043+
* {@link #setReadType(ReadType)} instead. And for the one rpc optimization, now we will also
1044+
* fetch data when openScanner, and if the number of rows reaches the limit then we will close
1045+
* the scanner automatically which means we will fall back to one rpc.
10301046
* @see #setLimit(int)
10311047
* @see #setReadType(ReadType)
1048+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-17045">HBASE-17045</a>
10321049
*/
10331050
@Deprecated
10341051
public Scan setSmall(boolean small) {
@@ -1040,7 +1057,9 @@ public Scan setSmall(boolean small) {
10401057
/**
10411058
* Get whether this scan is a small scan
10421059
* @return true if small scan
1043-
* @deprecated since 2.0.0. See the comment of {@link #setSmall(boolean)}
1060+
* @deprecated since 2.0.0 and will be removed in 3.0.0. See the comment of
1061+
* {@link #setSmall(boolean)}
1062+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-17045">HBASE-17045</a>
10441063
*/
10451064
@Deprecated
10461065
public boolean isSmall() {

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

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ public SnapshotDescription(String name) {
3737
}
3838

3939
/**
40-
* @deprecated Use the version with the TableName instance instead
40+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use the version with the TableName
41+
* instance instead.
42+
* @see #SnapshotDescription(String, TableName)
43+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-16892">HBASE-16892</a>
4144
*/
4245
@Deprecated
4346
public SnapshotDescription(String name, String table) {
@@ -49,7 +52,10 @@ public SnapshotDescription(String name, TableName table) {
4952
}
5053

5154
/**
52-
* @deprecated Use the version with the TableName instance instead
55+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use the version with the TableName
56+
* instance instead.
57+
* @see #SnapshotDescription(String, TableName, SnapshotType)
58+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-16892">HBASE-16892</a>
5359
*/
5460
@Deprecated
5561
public SnapshotDescription(String name, String table, SnapshotType type) {
@@ -61,7 +67,10 @@ public SnapshotDescription(String name, TableName table, SnapshotType type) {
6167
}
6268

6369
/**
64-
* @deprecated Use the version with the TableName instance instead
70+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use the version with the TableName
71+
* instance instead.
72+
* @see #SnapshotDescription(String, TableName, SnapshotType, String)
73+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-16892">HBASE-16892</a>
6574
*/
6675
@Deprecated
6776
public SnapshotDescription(String name, String table, SnapshotType type, String owner) {
@@ -73,7 +82,10 @@ public SnapshotDescription(String name, TableName table, SnapshotType type, Stri
7382
}
7483

7584
/**
76-
* @deprecated Use the version with the TableName instance instead
85+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use the version with the TableName
86+
* instance instead.
87+
* @see #SnapshotDescription(String, TableName, SnapshotType, String, long, int)
88+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-16892">HBASE-16892</a>
7789
*/
7890
@Deprecated
7991
public SnapshotDescription(String name, String table, SnapshotType type, String owner,
@@ -96,7 +108,11 @@ public String getName() {
96108
}
97109

98110
/**
99-
* @deprecated Use getTableName() or getTableNameAsString() instead.
111+
* @deprecated since 2.0.0 and will be removed in 3.0.0. Use {@link #getTableName()} or
112+
* {@link #getTableNameAsString()} instead.
113+
* @see #getTableName()
114+
* @see #getTableNameAsString()
115+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-16892">HBASE-16892</a>
100116
*/
101117
@Deprecated
102118
public String getTable() {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ public interface TableDescriptor {
176176
*/
177177
TableName getTableName();
178178

179+
/**
180+
* @deprecated since 2.0.0 and will be removed in 3.0.0.
181+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15583">HBASE-15583</a>
182+
*/
179183
@Deprecated
180184
String getOwnerString();
181185

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,9 @@ public class TableDescriptorBuilder {
291291

292292
/**
293293
* Table descriptor for namespace table
294-
* @deprecated We have folded the data in namespace table into meta table, so do not use it any
295-
* more.
294+
* @deprecated since 3.0.0 and will be removed in 4.0.0. We have folded the data in namespace
295+
* table into meta table, so do not use it any more.
296+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-21154">HBASE-21154</a>
296297
*/
297298
@Deprecated
298299
public static final TableDescriptor NAMESPACE_TABLEDESC =
@@ -458,12 +459,20 @@ public TableDescriptorBuilder setNormalizationEnabled(final boolean isEnable) {
458459
return this;
459460
}
460461

462+
/**
463+
* @deprecated since 2.0.0 and will be removed in 3.0.0.
464+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15583">HBASE-15583</a>
465+
*/
461466
@Deprecated
462467
public TableDescriptorBuilder setOwner(User owner) {
463468
desc.setOwner(owner);
464469
return this;
465470
}
466471

472+
/**
473+
* @deprecated since 2.0.0 and will be removed in 3.0.0.
474+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15583">HBASE-15583</a>
475+
*/
467476
@Deprecated
468477
public TableDescriptorBuilder setOwnerString(String ownerString) {
469478
desc.setOwnerString(ownerString);
@@ -1502,17 +1511,29 @@ public void removeCoprocessor(String className) {
15021511
}
15031512
}
15041513

1514+
/**
1515+
* @deprecated since 2.0.0 and will be removed in 3.0.0.
1516+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15583">HBASE-15583</a>
1517+
*/
15051518
@Deprecated
15061519
public ModifyableTableDescriptor setOwner(User owner) {
15071520
return setOwnerString(owner != null ? owner.getShortName() : null);
15081521
}
15091522

1523+
/**
1524+
* @deprecated since 2.0.0 and will be removed in 3.0.0.
1525+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15583">HBASE-15583</a>
1526+
*/
15101527
// used by admin.rb:alter(table_name,*args) to update owner.
15111528
@Deprecated
15121529
public ModifyableTableDescriptor setOwnerString(String ownerString) {
15131530
return setValue(OWNER_KEY, ownerString);
15141531
}
15151532

1533+
/**
1534+
* @deprecated since 2.0.0 and will be removed in 3.0.0.
1535+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-15583">HBASE-15583</a>
1536+
*/
15161537
@Override
15171538
@Deprecated
15181539
public String getOwnerString() {

hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
* caveat, this filter is only useful for special cases
4444
* like org.apache.hadoop.hbase.mapreduce.RowCounter.
4545
* <p>
46-
* @deprecated Deprecated in 2.0. See HBASE-13347
46+
* @deprecated Deprecated in 2.0.0 and will be removed in 3.0.0.
47+
* @see <a href="https://issues.apache.org/jira/browse/HBASE-13347">HBASE-13347</a>
4748
*/
4849
@InterfaceAudience.Public
4950
@Deprecated

0 commit comments

Comments
 (0)