Skip to content

Commit 626d8b0

Browse files
committed
address comments
1 parent e8ed19a commit 626d8b0

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,12 @@ private Constants() {
775775
"fs.s3a." + Constants.AWS_SERVICE_IDENTIFIER_STS.toLowerCase()
776776
+ ".signing-algorithm";
777777

778+
/** Prefix for S3A client-specific properties. */
779+
public static final String FS_S3A_CLIENT_PREFIX = "fs.s3a.client.";
780+
781+
/** Custom headers postfix */
782+
public static final String CUSTOM_HEADER_POSTFIX = ".custom.headers";
783+
778784
/**
779785
* List of custom headers to be set on the service client.
780786
* Multiple parameters can be used to specify custom headers.
@@ -785,12 +791,12 @@ private Constants() {
785791
* CustomHeaders {@literal ->} 'Header1=Value1:Value2,Header2=Value1'
786792
*/
787793
public static final String CUSTOM_HEADERS_STS =
788-
"fs.s3a.client." + Constants.AWS_SERVICE_IDENTIFIER_STS.toLowerCase()
789-
+ ".custom.headers";
794+
FS_S3A_CLIENT_PREFIX + Constants.AWS_SERVICE_IDENTIFIER_STS.toLowerCase()
795+
+ CUSTOM_HEADER_POSTFIX;
790796

791797
public static final String CUSTOM_HEADERS_S3 =
792-
"fs.s3a.client." + Constants.AWS_SERVICE_IDENTIFIER_S3.toLowerCase()
793-
+ ".custom.headers";
798+
FS_S3A_CLIENT_PREFIX + Constants.AWS_SERVICE_IDENTIFIER_S3.toLowerCase()
799+
+ CUSTOM_HEADER_POSTFIX;
794800

795801
public static final String S3N_FOLDER_SUFFIX = "_$folder$";
796802
public static final String FS_S3A_BLOCK_SIZE = "fs.s3a.block.size";

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ private static void initRequestHeaders(Configuration conf,
440440
List<String> headerValues = Arrays.asList(valueString.split(":"));
441441
clientConfig.putHeader(header, headerValues);
442442
});
443+
LOG.debug("headers for {} client = {}", awsServiceIdentifier, clientConfig.headers());
443444
}
444445
}
445446

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/impl/TestAwsClientConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import java.time.Duration;
2323
import java.util.Arrays;
2424

25-
import org.apache.hadoop.util.Lists;
2625
import org.assertj.core.api.Assertions;
2726
import org.junit.After;
2827
import org.junit.Test;
@@ -31,6 +30,7 @@
3130

3231
import org.apache.hadoop.conf.Configuration;
3332
import org.apache.hadoop.test.AbstractHadoopTestBase;
33+
import org.apache.hadoop.util.Lists;
3434

3535
import static org.apache.hadoop.fs.s3a.Constants.AWS_SERVICE_IDENTIFIER_S3;
3636
import static org.apache.hadoop.fs.s3a.Constants.AWS_SERVICE_IDENTIFIER_STS;

0 commit comments

Comments
 (0)