Skip to content

Commit 2c9870d

Browse files
authored
Added path to client creation parameters
1 parent 4e8c0b9 commit 2c9870d

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,7 @@ private void bindAWSClient(URI name, boolean dtEnabled) throws IOException {
888888
S3ClientFactory.S3ClientCreationParameters parameters = null;
889889
parameters = new S3ClientFactory.S3ClientCreationParameters()
890890
.withCredentialSet(credentials)
891+
.withPath(name)
891892
.withEndpoint(endpoint)
892893
.withMetrics(statisticsContext.newStatisticsFromAwsSdk())
893894
.withPathStyleAccess(conf.getBoolean(PATH_STYLE_ACCESS, false))

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ final class S3ClientCreationParameters {
115115
*/
116116
private String userAgentSuffix = "";
117117

118+
/**
119+
* Path
120+
*/
121+
private URI pathUri = "";
122+
118123
/**
119124
* List of request handlers to include in the chain
120125
* of request execution in the SDK.
@@ -214,7 +219,23 @@ public S3ClientCreationParameters withUserAgentSuffix(
214219
return this;
215220
}
216221

217-
public String getEndpoint() {
222+
/**
223+
* Set path.
224+
* @param value new value
225+
* @return the path
226+
*/
227+
228+
public S3ClientCreationParameters withPath(
229+
final URI value) {
230+
pathUri = value;
231+
return this;
232+
}
233+
234+
public URI getPath() {
235+
return pathUri;
236+
}
237+
238+
public String getEndpoint() {
218239
return endpoint;
219240
}
220241

0 commit comments

Comments
 (0)