HADOOP-16332. Remove S3A dependency on http core.

Contributed by Steve Loughran.

Change-Id: I53209c993a405fefdb5e1b692d5a56d027d3b845
This commit is contained in:
Steve Loughran 2019-05-28 22:50:37 +01:00
parent 79d14d0d42
commit 0c73dba3a6
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
3 changed files with 3 additions and 8 deletions

View File

@ -406,11 +406,6 @@
<artifactId>hadoop-common</artifactId> <artifactId>hadoop-common</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>org.apache.hadoop</groupId> <groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId> <artifactId>hadoop-common</artifactId>

View File

@ -41,7 +41,6 @@
import org.apache.hadoop.fs.s3a.S3ObjectAttributes; import org.apache.hadoop.fs.s3a.S3ObjectAttributes;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static org.apache.http.HttpStatus.SC_PRECONDITION_FAILED;
/** /**
* Change tracking for input streams: the version ID or etag of the object is * Change tracking for input streams: the version ID or etag of the object is
@ -57,6 +56,8 @@ public class ChangeTracker {
private static final Logger LOG = private static final Logger LOG =
LoggerFactory.getLogger(ChangeTracker.class); LoggerFactory.getLogger(ChangeTracker.class);
/** {@code 412 Precondition Failed} (HTTP/1.1 - RFC 2616) */
public static final int SC_PRECONDITION_FAILED = 412;
public static final String CHANGE_REPORTED_BY_S3 = "Change reported by S3"; public static final String CHANGE_REPORTED_BY_S3 = "Change reported by S3";
/** Policy to use. */ /** Policy to use. */

View File

@ -36,7 +36,6 @@
import org.apache.hadoop.fs.s3a.impl.ChangeDetectionPolicy; import org.apache.hadoop.fs.s3a.impl.ChangeDetectionPolicy;
import org.apache.hadoop.fs.s3a.impl.ChangeTracker; import org.apache.hadoop.fs.s3a.impl.ChangeTracker;
import org.apache.hadoop.test.HadoopTestBase; import org.apache.hadoop.test.HadoopTestBase;
import org.apache.http.HttpStatus;
import static org.apache.hadoop.fs.s3a.impl.ChangeDetectionPolicy.CHANGE_DETECTED; import static org.apache.hadoop.fs.s3a.impl.ChangeDetectionPolicy.CHANGE_DETECTED;
import static org.apache.hadoop.fs.s3a.impl.ChangeDetectionPolicy.createPolicy; import static org.apache.hadoop.fs.s3a.impl.ChangeDetectionPolicy.createPolicy;
@ -250,7 +249,7 @@ public void testCopyVersionMismatch() throws Throwable {
// https://github.com/aws/aws-sdk-java/issues/1644 // https://github.com/aws/aws-sdk-java/issues/1644
AmazonServiceException awsException = AmazonServiceException awsException =
new AmazonServiceException("aws exception"); new AmazonServiceException("aws exception");
awsException.setStatusCode(HttpStatus.SC_PRECONDITION_FAILED); awsException.setStatusCode(ChangeTracker.SC_PRECONDITION_FAILED);
expectChangeException(tracker, awsException, "copy", expectChangeException(tracker, awsException, "copy",
RemoteFileChangedException.PRECONDITIONS_FAILED); RemoteFileChangedException.PRECONDITIONS_FAILED);