steveloughran commented on a change in pull request #3133:
URL: https://github.com/apache/hadoop/pull/3133#discussion_r656942766



##########
File path: 
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/DefaultS3ClientFactory.java
##########
@@ -141,6 +142,10 @@ protected AmazonS3 buildAmazonS3Client(
       // no idea what the endpoint is, so tell the SDK
       // to work it out at the cost of an extra HEAD request
       b.withForceGlobalBucketAccessEnabled(true);
+      // HADOOP-17771 force set the region so the build process doesn't halt.
+      String region = getConf().getTrimmed(AWS_REGION, AWS_S3_CENTRAL_REGION);
+      LOG.debug("Using default endpoint; setting region to {}", region);
+      b.setRegion(region);

Review comment:
       skip if region is empty?, so a config has set fs.s3a.endpoint=""; if we 
skip calling setRegion() there, then the connector will go to the SDK region 
resolution process, including picking up info from EC2 metadata

##########
File path: 
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/Constants.java
##########
@@ -1087,4 +1087,11 @@ private Constants() {
    */
   public static final String AWS_REGION = "fs.s3a.endpoint.region";
 
+  /**
+   * The special S3 region which can be used to talk to any bucket if
+   * the global bucket resolution is enabled (which it is...)

Review comment:
       need a .




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to