Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public class DefaultS3ClientFactory extends Configured
@Override
public AmazonS3 createS3Client(
final URI uri,
final URI name,
final S3ClientCreationParameters parameters) throws IOException {
Configuration conf = getConf();
bucket = uri.getHost();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ private void bindAWSClient(URI name, boolean dtEnabled) throws IOException {
.withRequestHandlers(auditManager.createRequestHandlers());

s3 = ReflectionUtils.newInstance(s3ClientFactoryClass, conf)
.createS3Client(getUri(),
.createS3Client(getUri(), name,
parameters);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ public interface S3ClientFactory {
* Creates a new {@link AmazonS3} client.
*
* @param uri S3A file system URI
* @param name S3A file system URI that contains the full path
* @param parameters parameter object
* @return S3 client
* @throws IOException IO problem
*/
AmazonS3 createS3Client(URI uri,
AmazonS3 createS3Client(URI uri, URI name,
S3ClientCreationParameters parameters) throws IOException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ private AmazonS3 createS3Client(Configuration conf,
.newStatisticsFromAwsSdk());
AmazonS3 client = factory.createS3Client(
new URI("s3a://localhost/"),
new URI("s3a://localhost/path/")
parameters);
Assertions.assertThat(client.getRegionName())
.describedAs("Client region name")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public class MockS3ClientFactory implements S3ClientFactory {

@Override
public AmazonS3 createS3Client(URI uri,
public AmazonS3 createS3Client(URI uri, URI name,
final S3ClientCreationParameters parameters) {
AmazonS3 s3 = mock(AmazonS3.class);
String bucket = uri.getHost();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ protected ObjectMetadata readLandsatMetadata(final S3AFileSystem delegatedFS)
.withMetrics(new EmptyS3AStatisticsContext()
.newStatisticsFromAwsSdk())
.withUserAgentSuffix("ITestSessionDelegationInFileystem");
AmazonS3 s3 = factory.createS3Client(landsat, parameters);
AmazonS3 s3 = factory.createS3Client(landsat, landsat, parameters);

return Invoker.once("HEAD", host,
() -> s3.getObjectMetadata(host, landsat.getPath().substring(1)));
Expand Down