Skip to content

Commit 1057baa

Browse files
steveloughranprabhjyotsingh
authored andcommitted
HADOOP-19654. Upgrade AWS SDK to 2.35.4 (apache#7882)
AWS SDK upgraded to 2.35.4. This SDK has changed checksum/checksum headers handling significantly, causing problems with third party stores, and, in some combinations AWS S3 itself. The S3A connector has retained old behavior; options to change these settings are now available. The default settings are chosen for maximum compatiblity and performance. fs.s3a.request.md5.header: true fs.s3a.checksum.generation: false fs.s3a.create.checksum.algorithm: "" Consult the documentation for more details. Contributed by Steve Loughran
1 parent a5d79cc commit 1057baa

65 files changed

Lines changed: 12381 additions & 4244 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LICENSE-binary

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,9 @@ org.lz4:lz4-java:1.7.1
366366
org.objenesis:objenesis:2.6
367367
org.xerial.snappy:snappy-java:1.1.8.2
368368
org.yaml:snakeyaml:2.0
369-
org.wildfly.openssl:wildfly-openssl:1.1.3.Final
370-
369+
org.wildfly.openssl:wildfly-openssl:2.2.5.Final
370+
software.amazon.awssdk:bundle:2.35.4
371+
software.amazon.s3.analyticsaccelerator:analyticsaccelerator-s3:1.3.0
371372

372373
--------------------------------------------------------------------------------
373374
This product bundles various third-party components under other open source

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractUnbufferTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package org.apache.hadoop.fs.contract;
2020

21+
import org.assertj.core.api.Assertions;
2122
import org.junit.Test;
2223

2324
import java.io.IOException;
@@ -28,6 +29,7 @@
2829

2930
import static org.apache.hadoop.fs.contract.ContractTestUtils.createFile;
3031
import static org.apache.hadoop.fs.contract.ContractTestUtils.dataset;
32+
import static org.apache.hadoop.fs.contract.ContractTestUtils.readNBytes;
3133

3234
/**
3335
* Contract tests for {@link org.apache.hadoop.fs.CanUnbuffer#unbuffer}.
@@ -136,10 +138,12 @@ protected void validateFileContents(FSDataInputStream stream, int length,
136138
int startIndex)
137139
throws IOException {
138140
byte[] streamData = new byte[length];
139-
assertEquals("failed to read expected number of bytes from "
140-
+ "stream. This may be transient",
141-
length, stream.read(streamData));
141+
final int read = readNBytes(stream, streamData, 0, length);
142+
Assertions.assertThat(read)
143+
.describedAs("failed to read expected number of bytes from stream. %s", stream)
144+
.isEqualTo(length);
142145
byte[] validateFileBytes;
146+
143147
if (startIndex == 0 && length == fileBytes.length) {
144148
validateFileBytes = fileBytes;
145149
} else {

hadoop-project/pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@
190190
<exec-maven-plugin.version>1.3.1</exec-maven-plugin.version>
191191
<make-maven-plugin.version>1.0-beta-1</make-maven-plugin.version>
192192
<surefire.fork.timeout>900</surefire.fork.timeout>
193-
<aws-java-sdk.version>1.12.782</aws-java-sdk.version>
193+
<aws-java-sdk.version>1.12.720</aws-java-sdk.version>
194+
<aws-java-sdk-v2.version>2.35.4</aws-java-sdk-v2.version>
195+
<amazon-s3-encryption-client-java.version>3.1.1</amazon-s3-encryption-client-java.version>
196+
<amazon-s3-analyticsaccelerator-s3.version>1.3.0</amazon-s3-analyticsaccelerator-s3.version>
197+
<aws.eventstream.version>1.0.1</aws.eventstream.version>
194198
<hsqldb.version>2.7.1</hsqldb.version>
195199
<frontend-maven-plugin.version>1.11.2</frontend-maven-plugin.version>
196200
<jasmine-maven-plugin.version>2.1</jasmine-maven-plugin.version>

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/AWSClientIOException.java

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,44 @@
1818

1919
package org.apache.hadoop.fs.s3a;
2020

21-
import com.amazonaws.AmazonClientException;
22-
import com.amazonaws.SdkBaseException;
23-
import org.apache.hadoop.thirdparty.com.google.common.base.Preconditions;
21+
import software.amazon.awssdk.core.exception.SdkException;
22+
import org.apache.hadoop.util.Preconditions;
2423

2524
import java.io.IOException;
2625

2726
/**
28-
* IOException equivalent of an {@link AmazonClientException}.
27+
* IOException equivalent of an {@link SdkException}.
2928
*/
3029
public class AWSClientIOException extends IOException {
3130

3231
private final String operation;
3332

3433
public AWSClientIOException(String operation,
35-
SdkBaseException cause) {
34+
SdkException cause) {
3635
super(cause);
3736
Preconditions.checkArgument(operation != null, "Null 'operation' argument");
3837
Preconditions.checkArgument(cause != null, "Null 'cause' argument");
3938
this.operation = operation;
4039
}
4140

42-
public AmazonClientException getCause() {
43-
return (AmazonClientException) super.getCause();
41+
public SdkException getCause() {
42+
return (SdkException) super.getCause();
4443
}
4544

4645
@Override
4746
public String getMessage() {
4847
return operation + ": " + getCause().getMessage();
4948
}
5049

50+
/**
51+
* Query inner cause for retryability.
52+
* @return what the cause says.
53+
*/
54+
public boolean retryable() {
55+
return getCause().retryable();
56+
}
57+
58+
public String getOperation() {
59+
return operation;
60+
}
5161
}

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/AWSNoResponseException.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
* Status code 443, no response from server. This is considered idempotent.
2525
*/
2626
public class AWSNoResponseException extends AWSServiceIOException {
27+
28+
/**
29+
* Constructor.
30+
* @param operation operation in progress.
31+
* @param cause inner cause
32+
*/
2733
public AWSNoResponseException(String operation,
2834
AmazonServiceException cause) {
2935
super(operation, cause);

0 commit comments

Comments
 (0)