Skip to content

Commit

Permalink
Arrow, AWS, Core: Remove deprecated code for 1.5.0 release (apache#9505)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajantha-bhat authored and geruh committed Jan 25, 2024
1 parent 2ffaf15 commit 0bcee51
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 800 deletions.
61 changes: 57 additions & 4 deletions .palantir/revapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,10 @@ acceptedBreaks:
justification: "Static utility class - should not have public constructor"
"1.4.0":
org.apache.iceberg:iceberg-core:
- code: "java.class.defaultSerializationChanged"
old: "class org.apache.iceberg.mapping.NameMapping"
new: "class org.apache.iceberg.mapping.NameMapping"
justification: "Serialization across versions is not guaranteed"
- code: "java.class.noLongerImplementsInterface"
old: "class org.apache.iceberg.AllDataFilesTable"
new: "class org.apache.iceberg.AllDataFilesTable"
Expand Down Expand Up @@ -942,25 +946,74 @@ acceptedBreaks:
old: "class org.apache.iceberg.SnapshotsTable"
new: "class org.apache.iceberg.SnapshotsTable"
justification: "Removing deprecated code"
- code: "java.class.defaultSerializationChanged"
old: "class org.apache.iceberg.mapping.NameMapping"
new: "class org.apache.iceberg.mapping.NameMapping"
justification: "Serialization across versions is not guaranteed"
- code: "java.class.removed"
old: "class org.apache.iceberg.actions.BinPackStrategy"
justification: "Removing deprecated code"
- code: "java.class.removed"
old: "class org.apache.iceberg.actions.SortStrategy"
justification: "Removing deprecated code"
- code: "java.class.removed"
old: "class org.apache.iceberg.rest.RESTSerializers.UpdateRequirementDeserializer"
justification: "Removing deprecated code"
- code: "java.class.removed"
old: "class org.apache.iceberg.rest.RESTSerializers.UpdateRequirementSerializer"
justification: "Removing deprecated code"
- code: "java.class.removed"
old: "class org.apache.iceberg.rest.requests.UpdateRequirementParser"
justification: "Removing deprecated code"
- code: "java.class.removed"
old: "class org.apache.iceberg.rest.requests.UpdateTableRequest.Builder"
justification: "Removing deprecated code"
- code: "java.class.removed"
old: "interface org.apache.iceberg.actions.RewriteStrategy"
justification: "Removing deprecated code"
- code: "java.class.removed"
old: "interface org.apache.iceberg.rest.requests.UpdateTableRequest.UpdateRequirement"
justification: "Removing deprecated code"
- code: "java.field.serialVersionUIDChanged"
new: "field org.apache.iceberg.util.SerializableMap<K, V>.serialVersionUID"
justification: "Serialization is not be used"
- code: "java.method.removed"
old: "method org.apache.iceberg.TableOperations org.apache.iceberg.BaseMetadataTable::operations()"
justification: "Removing deprecated code"
- code: "java.method.removed"
old: "method org.apache.iceberg.encryption.EncryptedOutputFile org.apache.iceberg.io.ClusteredWriter<T,\
\ R>::newOutputFile(org.apache.iceberg.io.OutputFileFactory, org.apache.iceberg.PartitionSpec,\
\ org.apache.iceberg.StructLike) @ org.apache.iceberg.io.ClusteredDataWriter<T>"
justification: "Removing deprecated code"
- code: "java.method.removed"
old: "method org.apache.iceberg.encryption.EncryptedOutputFile org.apache.iceberg.io.ClusteredWriter<T,\
\ R>::newOutputFile(org.apache.iceberg.io.OutputFileFactory, org.apache.iceberg.PartitionSpec,\
\ org.apache.iceberg.StructLike) @ org.apache.iceberg.io.ClusteredEqualityDeleteWriter<T>"
justification: "Removing deprecated code"
- code: "java.method.removed"
old: "method org.apache.iceberg.encryption.EncryptedOutputFile org.apache.iceberg.io.ClusteredWriter<T,\
\ R>::newOutputFile(org.apache.iceberg.io.OutputFileFactory, org.apache.iceberg.PartitionSpec,\
\ org.apache.iceberg.StructLike) @ org.apache.iceberg.io.ClusteredPositionDeleteWriter<T>"
justification: "Removing deprecated code"
- code: "java.method.removed"
old: "method org.apache.iceberg.encryption.EncryptedOutputFile org.apache.iceberg.io.FanoutWriter<T,\
\ R>::newOutputFile(org.apache.iceberg.io.OutputFileFactory, org.apache.iceberg.PartitionSpec,\
\ org.apache.iceberg.StructLike) @ org.apache.iceberg.io.FanoutDataWriter<T>"
justification: "Removing deprecated code"
- code: "java.method.removed"
old: "method org.apache.iceberg.encryption.EncryptedOutputFile org.apache.iceberg.io.FanoutWriter<T,\
\ R>::newOutputFile(org.apache.iceberg.io.OutputFileFactory, org.apache.iceberg.PartitionSpec,\
\ org.apache.iceberg.StructLike) @ org.apache.iceberg.io.FanoutPositionOnlyDeleteWriter<T>"
justification: "Removing deprecated code"
- code: "java.method.removed"
old: "method org.apache.iceberg.rest.requests.UpdateTableRequest.Builder org.apache.iceberg.rest.requests.UpdateTableRequest::builderFor(org.apache.iceberg.TableMetadata)"
justification: "Removing deprecated code"
- code: "java.method.removed"
old: "method org.apache.iceberg.rest.requests.UpdateTableRequest.Builder org.apache.iceberg.rest.requests.UpdateTableRequest::builderForCreate()"
justification: "Removing deprecated code"
- code: "java.method.removed"
old: "method org.apache.iceberg.rest.requests.UpdateTableRequest.Builder org.apache.iceberg.rest.requests.UpdateTableRequest::builderForReplace(org.apache.iceberg.TableMetadata)"
justification: "Removing deprecated code"
- code: "java.method.removed"
old: "method void org.apache.iceberg.PositionDeletesTable.PositionDeletesBatchScan::<init>(org.apache.iceberg.Table,\
\ org.apache.iceberg.Schema, org.apache.iceberg.TableScanContext)"
justification: "Removing deprecated code"
apache-iceberg-0.14.0:
org.apache.iceberg:iceberg-api:
- code: "java.class.defaultSerializationChanged"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ public static <T> VectorHolder constantHolder(
return new ConstantVectorHolder<>(icebergField, numRows, constantValue);
}

/** @deprecated since 1.4.0, will be removed in 1.5.0; use typed constant holders instead. */
@Deprecated
public static <T> VectorHolder constantHolder(int numRows, T constantValue) {
return new ConstantVectorHolder<>(numRows, constantValue);
}

public static VectorHolder deletedVectorHolder(int numRows) {
return new DeletedVectorHolder(numRows);
}
Expand All @@ -150,13 +144,6 @@ public ConstantVectorHolder(int numRows) {
this.constantValue = null;
}

/** @deprecated since 1.4.0, will be removed in 1.5.0; use typed constant holders instead. */
@Deprecated
public ConstantVectorHolder(int numRows, T constantValue) {
this.numRows = numRows;
this.constantValue = constantValue;
}

public ConstantVectorHolder(Types.NestedField icebergField, int numRows, T constantValue) {
super(icebergField);
this.numRows = numRows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,12 +572,6 @@ public void close() {
public static class ConstantVectorReader<T> extends VectorizedArrowReader {
private final T value;

/** @deprecated since 1.4.0, will be removed in 1.5.0; use typed constant readers. */
@Deprecated
public ConstantVectorReader(T value) {
this.value = value;
}

public ConstantVectorReader(Types.NestedField icebergField, T value) {
super(icebergField);
this.value = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public GlueClient glue() {
.applyMutation(awsClientProperties::applyClientRegionConfiguration)
.applyMutation(httpClientProperties::applyHttpClientConfigurations)
.applyMutation(awsProperties::applyGlueEndpointConfigurations)
.applyMutation(awsProperties::applyClientCredentialConfigurations)
.applyMutation(awsClientProperties::applyClientCredentialConfigurations)
.build();
}

Expand All @@ -131,7 +131,7 @@ public KmsClient kms() {
return KmsClient.builder()
.applyMutation(awsClientProperties::applyClientRegionConfiguration)
.applyMutation(httpClientProperties::applyHttpClientConfigurations)
.applyMutation(awsProperties::applyClientCredentialConfigurations)
.applyMutation(awsClientProperties::applyClientCredentialConfigurations)
.build();
}

Expand All @@ -140,7 +140,7 @@ public DynamoDbClient dynamo() {
return DynamoDbClient.builder()
.applyMutation(awsClientProperties::applyClientRegionConfiguration)
.applyMutation(httpClientProperties::applyHttpClientConfigurations)
.applyMutation(awsProperties::applyClientCredentialConfigurations)
.applyMutation(awsClientProperties::applyClientCredentialConfigurations)
.applyMutation(awsProperties::applyDynamoDbEndpointConfigurations)
.build();
}
Expand Down
50 changes: 0 additions & 50 deletions aws/src/main/java/org/apache/iceberg/aws/AwsProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import java.io.Serializable;
import java.net.URI;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
Expand All @@ -30,18 +29,15 @@
import org.apache.iceberg.common.DynMethods;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.iceberg.relocated.com.google.common.base.Strings;
import org.apache.iceberg.relocated.com.google.common.collect.Maps;
import org.apache.iceberg.relocated.com.google.common.collect.Sets;
import org.apache.iceberg.util.PropertyUtil;
import org.apache.iceberg.util.SerializableMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.awscore.client.builder.AwsClientBuilder;
import software.amazon.awssdk.core.client.builder.SdkClientBuilder;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain;
Expand Down Expand Up @@ -215,15 +211,13 @@ public class AwsProperties implements Serializable {
public static final String REST_SESSION_TOKEN = "rest.session-token";

private static final String HTTP_CLIENT_PREFIX = "http-client.";
private final Map<String, String> httpClientProperties;
private final Set<software.amazon.awssdk.services.sts.model.Tag> stsClientAssumeRoleTags;

private String clientAssumeRoleArn;
private String clientAssumeRoleExternalId;
private int clientAssumeRoleTimeoutSec;
private String clientAssumeRoleRegion;
private String clientAssumeRoleSessionName;
private String clientRegion;
private String clientCredentialsProvider;
private final Map<String, String> clientCredentialsProviderProperties;

Expand All @@ -235,7 +229,6 @@ public class AwsProperties implements Serializable {

private String dynamoDbTableName;
private String dynamoDbEndpoint;
private final Map<String, String> allProperties;

private String restSigningRegion;
private String restSigningName;
Expand All @@ -244,15 +237,13 @@ public class AwsProperties implements Serializable {
private String restSessionToken;

public AwsProperties() {
this.httpClientProperties = Collections.emptyMap();
this.stsClientAssumeRoleTags = Sets.newHashSet();

this.clientAssumeRoleArn = null;
this.clientAssumeRoleTimeoutSec = CLIENT_ASSUME_ROLE_TIMEOUT_SEC_DEFAULT;
this.clientAssumeRoleExternalId = null;
this.clientAssumeRoleRegion = null;
this.clientAssumeRoleSessionName = null;
this.clientRegion = null;
this.clientCredentialsProvider = null;
this.clientCredentialsProviderProperties = null;

Expand All @@ -265,15 +256,11 @@ public AwsProperties() {
this.dynamoDbEndpoint = null;
this.dynamoDbTableName = DYNAMODB_TABLE_NAME_DEFAULT;

this.allProperties = Maps.newHashMap();

this.restSigningName = REST_SIGNING_NAME_DEFAULT;
}

@SuppressWarnings("MethodLength")
public AwsProperties(Map<String, String> properties) {
this.httpClientProperties =
PropertyUtil.filterProperties(properties, key -> key.startsWith(HTTP_CLIENT_PREFIX));
this.stsClientAssumeRoleTags = toStsTags(properties, CLIENT_ASSUME_ROLE_TAGS_PREFIX);
this.clientAssumeRoleArn = properties.get(CLIENT_ASSUME_ROLE_ARN);
this.clientAssumeRoleTimeoutSec =
Expand All @@ -282,7 +269,6 @@ public AwsProperties(Map<String, String> properties) {
this.clientAssumeRoleExternalId = properties.get(CLIENT_ASSUME_ROLE_EXTERNAL_ID);
this.clientAssumeRoleRegion = properties.get(CLIENT_ASSUME_ROLE_REGION);
this.clientAssumeRoleSessionName = properties.get(CLIENT_ASSUME_ROLE_SESSION_NAME);
this.clientRegion = properties.get(AwsClientProperties.CLIENT_REGION);
this.clientCredentialsProvider =
properties.get(AwsClientProperties.CLIENT_CREDENTIALS_PROVIDER);
this.clientCredentialsProviderProperties =
Expand All @@ -307,8 +293,6 @@ public AwsProperties(Map<String, String> properties) {
this.dynamoDbTableName =
PropertyUtil.propertyAsString(properties, DYNAMODB_TABLE_NAME, DYNAMODB_TABLE_NAME_DEFAULT);

this.allProperties = SerializableMap.copyOf(properties);

this.restSigningRegion = properties.get(REST_SIGNER_REGION);
this.restSigningName = properties.getOrDefault(REST_SIGNING_NAME, REST_SIGNING_NAME_DEFAULT);
this.restAccessKeyId = properties.get(REST_ACCESS_KEY_ID);
Expand Down Expand Up @@ -380,40 +364,6 @@ public void setDynamoDbTableName(String name) {
this.dynamoDbTableName = name;
}

/** @deprecated will be removed in 1.5.0, use {@link HttpClientProperties} instead */
@Deprecated
public Map<String, String> httpClientProperties() {
return httpClientProperties;
}

/**
* @deprecated will be removed in 1.5.0, use {@link AwsClientProperties#clientRegion()} instead
*/
@Deprecated
public String clientRegion() {
return clientRegion;
}

/**
* @deprecated will be removed in 1.5.0, use {@link AwsClientProperties#setClientRegion(String)}
* instead
*/
@Deprecated
public void setClientRegion(String clientRegion) {
this.clientRegion = clientRegion;
}

/**
* @deprecated will be removed in 1.5.0, use {@link
* AwsClientProperties#applyClientCredentialConfigurations(AwsClientBuilder)} instead
*/
@Deprecated
public <T extends AwsClientBuilder> void applyClientCredentialConfigurations(T builder) {
if (!Strings.isNullOrEmpty(this.clientCredentialsProvider)) {
builder.credentialsProvider(credentialsProvider(this.clientCredentialsProvider));
}
}

/**
* Override the endpoint for a glue client.
*
Expand Down
25 changes: 9 additions & 16 deletions aws/src/test/java/org/apache/iceberg/aws/TestAwsProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
*/
package org.apache.iceberg.aws;

import static org.apache.iceberg.aws.AwsProperties.DYNAMODB_TABLE_NAME;
import static org.apache.iceberg.aws.AwsProperties.GLUE_CATALOG_ID;

import java.io.IOException;
import java.util.Collections;
import org.apache.iceberg.TestHelpers;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
import org.assertj.core.api.Assertions;
Expand All @@ -29,22 +31,13 @@ public class TestAwsProperties {

@Test
public void testKryoSerialization() throws IOException {
AwsProperties awsProperties = new AwsProperties();
AwsProperties deSerializedAwsProperties =
TestHelpers.KryoHelpers.roundTripSerialize(awsProperties);
Assertions.assertThat(deSerializedAwsProperties.httpClientProperties())
.isEqualTo(awsProperties.httpClientProperties());

AwsProperties awsPropertiesWithProps = new AwsProperties(ImmutableMap.of("a", "b"));
AwsProperties awsPropertiesWithProps =
new AwsProperties(ImmutableMap.of(GLUE_CATALOG_ID, "foo", DYNAMODB_TABLE_NAME, "ice"));
AwsProperties deSerializedAwsPropertiesWithProps =
TestHelpers.KryoHelpers.roundTripSerialize(awsPropertiesWithProps);
Assertions.assertThat(deSerializedAwsPropertiesWithProps.httpClientProperties())
.isEqualTo(awsProperties.httpClientProperties());

AwsProperties awsPropertiesWithEmptyProps = new AwsProperties(Collections.emptyMap());
AwsProperties deSerializedAwsPropertiesWithEmptyProps =
TestHelpers.KryoHelpers.roundTripSerialize(awsPropertiesWithProps);
Assertions.assertThat(deSerializedAwsPropertiesWithEmptyProps.httpClientProperties())
.isEqualTo(awsProperties.httpClientProperties());
Assertions.assertThat(deSerializedAwsPropertiesWithProps.glueCatalogId())
.isEqualTo(awsPropertiesWithProps.glueCatalogId());
Assertions.assertThat(deSerializedAwsPropertiesWithProps.dynamoDbTableName())
.isEqualTo(awsPropertiesWithProps.dynamoDbTableName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ public void testUrlConnectionOverrideConfigurations() {
properties.put(HttpClientProperties.URLCONNECTION_CONNECTION_TIMEOUT_MS, "80");
properties.put(HttpClientProperties.APACHE_SOCKET_TIMEOUT_MS, "100");
properties.put(HttpClientProperties.APACHE_CONNECTION_TIMEOUT_MS, "200");
AwsProperties awsProperties = new AwsProperties(properties);
UrlConnectionHttpClientConfigurations urlConnectionHttpClientConfigurations =
UrlConnectionHttpClientConfigurations.create(awsProperties.httpClientProperties());
UrlConnectionHttpClientConfigurations.create(properties);
UrlConnectionHttpClient.Builder urlConnectionHttpClientBuilder =
UrlConnectionHttpClient.builder();
UrlConnectionHttpClient.Builder spyUrlConnectionHttpClientBuilder =
Expand All @@ -51,10 +50,8 @@ public void testUrlConnectionOverrideConfigurations() {

@Test
public void testUrlConnectionDefaultConfigurations() {
Map<String, String> properties = Maps.newHashMap();
AwsProperties awsProperties = new AwsProperties(properties);
UrlConnectionHttpClientConfigurations urlConnectionHttpClientConfigurations =
UrlConnectionHttpClientConfigurations.create(awsProperties.httpClientProperties());
UrlConnectionHttpClientConfigurations.create(Maps.newHashMap());
UrlConnectionHttpClient.Builder urlConnectionHttpClientBuilder =
UrlConnectionHttpClient.builder();
UrlConnectionHttpClient.Builder spyUrlConnectionHttpClientBuilder =
Expand Down Expand Up @@ -83,9 +80,8 @@ public void testApacheOverrideConfigurations() {
properties.put(HttpClientProperties.APACHE_MAX_CONNECTIONS, "104");
properties.put(HttpClientProperties.APACHE_TCP_KEEP_ALIVE_ENABLED, "true");
properties.put(HttpClientProperties.APACHE_USE_IDLE_CONNECTION_REAPER_ENABLED, "false");
AwsProperties awsProperties = new AwsProperties(properties);
ApacheHttpClientConfigurations apacheHttpClientConfigurations =
ApacheHttpClientConfigurations.create(awsProperties.httpClientProperties());
ApacheHttpClientConfigurations.create(properties);
ApacheHttpClient.Builder apacheHttpClientBuilder = ApacheHttpClient.builder();
ApacheHttpClient.Builder spyApacheHttpClientBuilder = Mockito.spy(apacheHttpClientBuilder);

Expand All @@ -104,10 +100,8 @@ public void testApacheOverrideConfigurations() {

@Test
public void testApacheDefaultConfigurations() {
Map<String, String> properties = Maps.newHashMap();
AwsProperties awsProperties = new AwsProperties(properties);
ApacheHttpClientConfigurations apacheHttpClientConfigurations =
ApacheHttpClientConfigurations.create(awsProperties.httpClientProperties());
ApacheHttpClientConfigurations.create(Maps.newHashMap());
ApacheHttpClient.Builder apacheHttpClientBuilder = ApacheHttpClient.builder();
ApacheHttpClient.Builder spyApacheHttpClientBuilder = Mockito.spy(apacheHttpClientBuilder);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ protected PositionDeletesBatchScan(Table table, Schema schema) {
super(table, schema, TableScanContext.empty());
}

/** @deprecated the API will be removed in v1.5.0 */
@Deprecated
protected PositionDeletesBatchScan(Table table, Schema schema, TableScanContext context) {
super(table, schema, context);
}

protected PositionDeletesBatchScan(
Table table, Schema schema, TableScanContext context, Expression baseTableFilter) {
super(table, schema, context);
Expand Down
Loading

0 comments on commit 0bcee51

Please sign in to comment.