Skip to content

Commit 466f2f1

Browse files
committed
ORC-1977: Add Deprecated annotations for all deprecated APIs
### What changes were proposed in this pull request? This PR aims to add `Deprecated` annotations for all deprecated APIs. ### Why are the changes needed? To improve the visibility of deprecations. Currently, only Javadoc informs the deprecation for these APIs. **BEFORE** ``` $ mvn clean package -DskipTests | grep Deprecated | wc -l 15 ``` **AFTER** ``` $ mvn clean package -DskipTests | grep Deprecated | wc -l 0 ``` ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #2365 from dongjoon-hyun/ORC-1977. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
1 parent dae7efc commit 466f2f1

10 files changed

Lines changed: 15 additions & 0 deletions

File tree

java/core/src/java/org/apache/orc/DateColumnStatistics.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ public interface DateColumnStatistics extends ColumnStatistics {
5454
* @return minimum value
5555
* @deprecated Use #getMinimumLocalDate instead
5656
*/
57+
@Deprecated
5758
Date getMinimum();
5859

5960
/**
6061
* Get the maximum value for the column.
6162
* @return maximum value
6263
* @deprecated Use #getMaximumLocalDate instead
6364
*/
65+
@Deprecated
6466
Date getMaximum();
6567
}

java/core/src/java/org/apache/orc/FileMetadata.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* ORC stop depending on them too. Luckily, they shouldn't be very big.
2727
* @deprecated Use {@link org.apache.orc.impl.OrcTail} instead
2828
*/
29+
@Deprecated
2930
public interface FileMetadata {
3031
boolean isOriginalFormat();
3132

java/core/src/java/org/apache/orc/MemoryManager.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ void addWriter(Path path, long requestedAllocation,
6565
* @throws IOException
6666
* @deprecated Use {@link MemoryManager#checkMemory} instead
6767
*/
68+
@Deprecated
6869
void addedRow(int rows) throws IOException;
6970

7071
/**

java/core/src/java/org/apache/orc/OrcFile.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ public KeyProvider getKeyProvider() {
357357
/**
358358
* @deprecated Use {@link #orcTail(OrcTail)} instead.
359359
*/
360+
@Deprecated
360361
public ReaderOptions fileMetadata(final FileMetadata metadata) {
361362
fileMetadata = metadata;
362363
return this;

java/core/src/java/org/apache/orc/Reader.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ public interface Reader extends Closeable {
145145
* @deprecated use getSchema instead
146146
* @since 1.1.0
147147
*/
148+
@Deprecated
148149
List<OrcProto.Type> getTypes();
149150

150151
/**
@@ -756,6 +757,7 @@ public Options rowBatchSize(int value) {
756757
* @deprecated Use {@link #getStripeStatistics()} instead.
757758
* @since 1.1.0
758759
*/
760+
@Deprecated
759761
List<OrcProto.StripeStatistics> getOrcProtoStripeStatistics();
760762

761763
/**
@@ -779,6 +781,7 @@ public Options rowBatchSize(int value) {
779781
* @deprecated Use {@link #getStatistics()} instead.
780782
* @since 1.1.0
781783
*/
784+
@Deprecated
782785
List<OrcProto.ColumnStatistics> getOrcProtoFileStatistics();
783786

784787
/**

java/core/src/java/org/apache/orc/Writer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ void appendStripe(byte[] stripe, int offset, int length,
139139
* @deprecated use {@link #addUserMetadata(String, ByteBuffer)} instead
140140
* @since 1.1.0
141141
*/
142+
@Deprecated
142143
void appendUserMetadata(List<OrcProto.UserMetadataItem> userMetadata);
143144

144145
/**

java/core/src/java/org/apache/orc/impl/MemoryManagerImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ public void addedRow(int rows) throws IOException {
134134
* Obsolete method left for Hive, which extends this class.
135135
* @deprecated remove this method
136136
*/
137+
@Deprecated
137138
public void notifyWriters() throws IOException {
138139
// PASS
139140
}

java/core/src/java/org/apache/orc/impl/OrcTail.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ public OrcProto.FileTail getMinimalFileTail() {
207207
* @return the stripe statistics
208208
* @deprecated the user should use Reader.getStripeStatistics instead.
209209
*/
210+
@Deprecated
210211
public List<StripeStatistics> getStripeStatistics() throws IOException {
211212
if (reader == null) {
212213
LOG.warn("Please use Reader.getStripeStatistics or give `Reader` to OrcTail constructor.");

java/core/src/java/org/apache/orc/impl/ReaderImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ protected static void ensureOrcFooter(FSDataInputStream in,
480480
* @param buffer the tail of the file
481481
* @deprecated Use {@link ReaderImpl#ensureOrcFooter(FSDataInputStream, Path, int, ByteBuffer)} instead.
482482
*/
483+
@Deprecated
483484
protected static void ensureOrcFooter(ByteBuffer buffer, int psLen) throws IOException {
484485
int magicLength = OrcFile.MAGIC.length();
485486
int fullLength = magicLength + 1;
@@ -717,6 +718,7 @@ private static void read(FSDataInputStream file,
717718
* @deprecated Use {@link ReaderImpl#extractFileTail(FileSystem, Path, long)} instead.
718719
* This is for backward compatibility.
719720
*/
721+
@Deprecated
720722
public static OrcTail extractFileTail(ByteBuffer buffer)
721723
throws IOException {
722724
return extractFileTail(buffer, -1,-1);
@@ -738,6 +740,7 @@ public static int getCompressionBlockSize(OrcProto.PostScript postScript) {
738740
* @deprecated Use {@link ReaderImpl#extractFileTail(FileSystem, Path, long)} instead.
739741
* This is for backward compatibility.
740742
*/
743+
@Deprecated
741744
public static OrcTail extractFileTail(ByteBuffer buffer, long fileLen, long modificationTime)
742745
throws IOException {
743746
OrcProto.PostScript ps;

java/core/src/java/org/apache/orc/impl/RecordReaderImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ public static class SargApplier {
11191119
/**
11201120
* @deprecated Use the constructor having full parameters. This exists for backward compatibility.
11211121
*/
1122+
@Deprecated
11221123
public SargApplier(SearchArgument sarg,
11231124
long rowIndexStride,
11241125
SchemaEvolution evolution,

0 commit comments

Comments
 (0)