Browse Source

Revert "HADOOP-18330. S3AFileSystem removes Path when calling createS3Client (#4557)"

(hadn't realised the PR was against 3.3.3)

This reverts commit 1c7b0bc5f47025d305d7654f9bcc06148c62aa7a.
Steve Loughran 2 years ago
parent
commit
15621e3415

+ 0 - 1
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java

@@ -888,7 +888,6 @@ public class S3AFileSystem extends FileSystem implements StreamCapabilities,
     S3ClientFactory.S3ClientCreationParameters parameters = null;
     parameters = new S3ClientFactory.S3ClientCreationParameters()
         .withCredentialSet(credentials)
-        .withPath(name)
         .withEndpoint(endpoint)
         .withMetrics(statisticsContext.newStatisticsFromAwsSdk())
         .withPathStyleAccess(conf.getBoolean(PATH_STYLE_ACCESS, false))

+ 0 - 27
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ClientFactory.java

@@ -115,12 +115,6 @@ public interface S3ClientFactory {
      */
     private String userAgentSuffix = "";
 
-    /**
-     * S3A path.
-     * added in HADOOP-18330
-     */
-    private URI pathUri;
-
     /**
      * List of request handlers to include in the chain
      * of request execution in the SDK.
@@ -270,26 +264,5 @@ public interface S3ClientFactory {
     public Map<String, String> getHeaders() {
       return headers;
     }
-
-    /**
-     * Get the full s3 path.
-     * added in HADOOP-18330
-     * @return path URI
-     */
-    public URI getPath() {
-      return pathUri;
-    }
-
-    /**
-     * Set full s3a path.
-     * added in HADOOP-18330
-     * @param value new value
-     * @return the builder
-     */
-    public S3ClientCreationParameters withPath(
-            final URI value) {
-      pathUri = value;
-      return this;
-    }
   }
 }

+ 0 - 1
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AEndpointRegion.java

@@ -176,7 +176,6 @@ public class ITestS3AEndpointRegion extends AbstractS3ATestBase {
     S3ClientFactory.S3ClientCreationParameters parameters
         = new S3ClientFactory.S3ClientCreationParameters()
         .withCredentialSet(new AnonymousAWSCredentialsProvider())
-        .withPath(new URI("s3a://localhost/"))
         .withEndpoint(endpoint)
         .withMetrics(new EmptyS3AStatisticsContext()
             .newStatisticsFromAwsSdk());

+ 0 - 1
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/auth/delegation/ITestSessionDelegationInFileystem.java

@@ -590,7 +590,6 @@ public class ITestSessionDelegationInFileystem extends AbstractDelegationIT {
     S3ClientFactory.S3ClientCreationParameters parameters = null;
     parameters = new S3ClientFactory.S3ClientCreationParameters()
         .withCredentialSet(testingCreds)
-        .withPath(new URI("s3a://localhost/"))
         .withEndpoint(DEFAULT_ENDPOINT)
         .withMetrics(new EmptyS3AStatisticsContext()
             .newStatisticsFromAwsSdk())