ahmarsuhail commented on code in PR #7443:
URL: https://github.com/apache/hadoop/pull/7443#discussion_r1986927570


##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/DefaultS3ClientFactory.java:
##########
@@ -175,6 +163,39 @@ public S3AsyncClient createS3AsyncClient(
     return s3AsyncClientBuilder.build();
   }
 
+  private S3AsyncClient createS3CrtAsyncClient(URI uri, 
S3ClientCreationParameters parameters)
+      throws IOException {
+    Configuration conf = getConf();
+    String bucket = uri.getHost();
+
+    S3CrtAsyncClientBuilder s3CrtAsyncClientBuilder = 
S3CrtAsyncClient.builder();
+
+    AWSRegionEndpointInformation regionEndpointInformation =
+        AWSRegionEndpointResolver.getEndpointRegionResolution(parameters, 
conf);
+
+    if (regionEndpointInformation.getRegion() != null) {
+      s3CrtAsyncClientBuilder.region(regionEndpointInformation.getRegion());
+    }
+
+    if (regionEndpointInformation.getEndpoint() != null) {
+      
s3CrtAsyncClientBuilder.endpointOverride(regionEndpointInformation.getEndpoint());

Review Comment:
   yeah, I haven't made any changes to the logic, just refactored it a bit. 
We've always had the ability for uses to set both the endpoint and the region.. 
I think maybe useful if you want to us a specific endpoint for a region (eg: 
fips enabled?) .. this whole logic does need a bit of a rethink and re-write, 
see: https://issues.apache.org/jira/browse/HADOOP-19470



-- 
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.

To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to