Skip to content

Commit

Permalink
Core: Remove deprecated APIs scheduled for removal in 1.6.0 (apache#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi authored and Sasank Pagolu committed Oct 27, 2024
1 parent c229390 commit 9ec96a6
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 80 deletions.
32 changes: 32 additions & 0 deletions .palantir/revapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,38 @@ acceptedBreaks:
old: "class org.apache.iceberg.types.Types.NestedField"
new: "class org.apache.iceberg.types.Types.NestedField"
justification: "new Constructor added"
org.apache.iceberg:iceberg-core:
- code: "java.method.visibilityReduced"
old: "method void org.apache.iceberg.encryption.PlaintextEncryptionManager::<init>()"
new: "method void org.apache.iceberg.encryption.PlaintextEncryptionManager::<init>()"
justification: "Deprecations for 1.6.0 release"
- code: "java.element.noLongerDeprecated"
old: "method void org.apache.iceberg.encryption.PlaintextEncryptionManager::<init>()"
new: "method void org.apache.iceberg.encryption.PlaintextEncryptionManager::<init>()"
justification: "Constructor became private as part of deprecations cleanup for 1.6.0 release"
- code: "java.element.noLongerDeprecated"
old: "method void org.apache.iceberg.rest.auth.OAuth2Util.AuthSession::<init>(java.util.Map<java.lang.String,\
\ java.lang.String>, java.lang.String, java.lang.String, java.lang.String,\
\ java.lang.String)"
new: "method void org.apache.iceberg.rest.auth.OAuth2Util.AuthSession::<init>(java.util.Map<java.lang.String,\
\ java.lang.String>, org.apache.iceberg.rest.auth.AuthConfig)"
justification: "This is actually a removal of a deprecated constructor as part\
\ of deprecations for 1.6.0 release, apparently mis-reported by rev-api"
- code: "java.method.numberOfParametersChanged"
old: "method void org.apache.iceberg.rest.auth.OAuth2Util.AuthSession::<init>(java.util.Map<java.lang.String,\
\ java.lang.String>, java.lang.String, java.lang.String, java.lang.String,\
\ java.lang.String)"
new: "method void org.apache.iceberg.rest.auth.OAuth2Util.AuthSession::<init>(java.util.Map<java.lang.String,\
\ java.lang.String>, org.apache.iceberg.rest.auth.AuthConfig)"
justification: "This is actually a removal of a deprecated constructor as part\
\ of deprecations for 1.6.0 release, apparently mis-reported by rev-api"
- code: "java.method.removed"
old: "method java.util.List<java.lang.String> org.apache.iceberg.ReachableFileUtil::statisticsFilesLocations(org.apache.iceberg.Table,\
\ java.util.function.Predicate<org.apache.iceberg.StatisticsFile>)"
justification: "Deprecations for 1.6.0 release"
- code: "java.method.removed"
old: "method org.apache.iceberg.DataFiles.Builder org.apache.iceberg.DataFiles.Builder::withEqualityFieldIds(java.util.List<java.lang.Integer>)"
justification: "Deprecations for 1.6.0 release"
apache-iceberg-0.14.0:
org.apache.iceberg:iceberg-api:
- code: "java.class.defaultSerializationChanged"
Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/org/apache/iceberg/DataFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,6 @@ public Builder withSplitOffsets(List<Long> offsets) {
return this;
}

/** @deprecated since 1.5.0, will be removed in 1.6.0; must not be set for data files. */
@Deprecated
public Builder withEqualityFieldIds(List<Integer> equalityIds) {
throw new UnsupportedOperationException("Equality field IDs must not be set for data files");
}

public Builder withEncryptionKeyMetadata(ByteBuffer newKeyMetadata) {
this.keyMetadata = newKeyMetadata;
return this;
Expand Down
19 changes: 0 additions & 19 deletions core/src/main/java/org/apache/iceberg/ReachableFileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.List;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.apache.hadoop.fs.Path;
import org.apache.iceberg.TableMetadata.MetadataLogEntry;
import org.apache.iceberg.hadoop.Util;
Expand Down Expand Up @@ -142,24 +141,6 @@ public static List<String> statisticsFilesLocations(Table table) {
return statisticsFilesLocationsForSnapshots(table, null);
}

/**
* Returns locations of statistics files for a table matching the given predicate .
*
* @param table table for which statistics files needs to be listed
* @param predicate predicate for filtering the statistics files
* @return the location of statistics files
* @deprecated since 1.5.0, will be removed in 1.6.0; use the {@code
* statisticsFilesLocationsForSnapshots(table, snapshotIds)} instead.
*/
@Deprecated
public static List<String> statisticsFilesLocations(
Table table, Predicate<StatisticsFile> predicate) {
return table.statisticsFiles().stream()
.filter(predicate)
.map(StatisticsFile::path)
.collect(Collectors.toList());
}

/**
* Returns locations of all statistics files for a table matching the given snapshot IDs.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ public class PlaintextEncryptionManager implements EncryptionManager {
private static final EncryptionManager INSTANCE = new PlaintextEncryptionManager();
private static final Logger LOG = LoggerFactory.getLogger(PlaintextEncryptionManager.class);

/** @deprecated will be removed in 1.6.0. use {@link #instance()} instead. */
@Deprecated
public PlaintextEncryptionManager() {}
private PlaintextEncryptionManager() {}

public static EncryptionManager instance() {
return INSTANCE;
Expand Down
18 changes: 0 additions & 18 deletions core/src/main/java/org/apache/iceberg/rest/auth/OAuth2Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,24 +465,6 @@ public AuthSession(Map<String, String> baseHeaders, AuthConfig config) {
this.config = config;
}

/** @deprecated since 1.5.0, will be removed in 1.6.0 */
@Deprecated
public AuthSession(
Map<String, String> baseHeaders,
String token,
String tokenType,
String credential,
String scope) {
this(
baseHeaders,
AuthConfig.builder()
.token(token)
.tokenType(tokenType)
.credential(credential)
.scope(scope)
.build());
}

/** @deprecated since 1.6.0, will be removed in 1.7.0 */
@Deprecated
public AuthSession(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static DataIterator<RowData> createDataIterator(CombinedScanTask combined
TestFixtures.SCHEMA, TestFixtures.SCHEMA, null, true, Collections.emptyList()),
combinedTask,
new HadoopFileIO(new org.apache.hadoop.conf.Configuration()),
new PlaintextEncryptionManager());
PlaintextEncryptionManager.instance());
}

public static List<List<Record>> createRecordBatchList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private IcebergSourceReader createReader(
null,
true,
new HadoopFileIO(new org.apache.hadoop.conf.Configuration()),
new PlaintextEncryptionManager(),
PlaintextEncryptionManager.instance(),
Collections.emptyList());
return new IcebergSourceReader<>(
SerializableRecordEmitter.defaultEmitter(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected ReaderFunction<RowData> readerFunction() {
null,
true,
new HadoopFileIO(new org.apache.hadoop.conf.Configuration()),
new PlaintextEncryptionManager(),
PlaintextEncryptionManager.instance(),
Collections.emptyList());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static DataIterator<RowData> createDataIterator(CombinedScanTask combined
TestFixtures.SCHEMA, TestFixtures.SCHEMA, null, true, Collections.emptyList()),
combinedTask,
new HadoopFileIO(new org.apache.hadoop.conf.Configuration()),
new PlaintextEncryptionManager());
PlaintextEncryptionManager.instance());
}

public static List<List<Record>> createRecordBatchList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private IcebergSourceReader createReader(
null,
true,
new HadoopFileIO(new org.apache.hadoop.conf.Configuration()),
new PlaintextEncryptionManager(),
PlaintextEncryptionManager.instance(),
Collections.emptyList());
return new IcebergSourceReader<>(
SerializableRecordEmitter.defaultEmitter(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected ReaderFunction<RowData> readerFunction() {
null,
true,
new HadoopFileIO(new org.apache.hadoop.conf.Configuration()),
new PlaintextEncryptionManager(),
PlaintextEncryptionManager.instance(),
Collections.emptyList());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static DataIterator<RowData> createDataIterator(CombinedScanTask combined
TestFixtures.SCHEMA, TestFixtures.SCHEMA, null, true, Collections.emptyList()),
combinedTask,
new HadoopFileIO(new org.apache.hadoop.conf.Configuration()),
new PlaintextEncryptionManager());
PlaintextEncryptionManager.instance());
}

public static List<List<Record>> createRecordBatchList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private IcebergSourceReader createReader(
null,
true,
new HadoopFileIO(new org.apache.hadoop.conf.Configuration()),
new PlaintextEncryptionManager(),
PlaintextEncryptionManager.instance(),
Collections.emptyList());
return new IcebergSourceReader<>(
SerializableRecordEmitter.defaultEmitter(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected ReaderFunction<RowData> readerFunction() {
null,
true,
new HadoopFileIO(new org.apache.hadoop.conf.Configuration()),
new PlaintextEncryptionManager(),
PlaintextEncryptionManager.instance(),
Collections.emptyList());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,19 +581,6 @@ private boolean dropContent(TableIdentifier identifier, boolean purge, Content.T
return false;
}

/** @deprecated will be removed after 1.5.0 */
@Deprecated
public void commitTable(
TableMetadata base,
TableMetadata metadata,
String newMetadataLocation,
IcebergTable expectedContent,
ContentKey key)
throws NessieConflictException, NessieNotFoundException {
String contentId = expectedContent == null ? null : expectedContent.getId();
commitTable(base, metadata, newMetadataLocation, contentId, key);
}

public void commitTable(
TableMetadata base,
TableMetadata metadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -694,18 +694,6 @@ private static void deleteManifests(FileIO io, List<ManifestFile> manifests) {
.run(item -> io.deleteFile(item.path()));
}

/**
* Loads a metadata table.
*
* @deprecated since 0.14.0, will be removed in 0.15.0; use {@link
* #loadMetadataTable(SparkSession, Table, MetadataTableType)}.
*/
@Deprecated
public static Dataset<Row> loadCatalogMetadataTable(
SparkSession spark, Table table, MetadataTableType type) {
return loadMetadataTable(spark, table, type);
}

public static Dataset<Row> loadMetadataTable(
SparkSession spark, Table table, MetadataTableType type) {
return loadMetadataTable(spark, table, type, ImmutableMap.of());
Expand Down

0 comments on commit 9ec96a6

Please sign in to comment.