Skip to content

Commit d55d76e

Browse files
authored
HADOOP-18371. S3A FS init to log at debug when fs.s3a.create.storage.class is unset (#4730)
Contributed By: Viraj Jasani
1 parent 622ca0d commit d55d76e

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,13 +1005,17 @@ protected RequestFactory createRequestFactory() {
10051005
String storageClassConf = getConf()
10061006
.getTrimmed(STORAGE_CLASS, "")
10071007
.toUpperCase(Locale.US);
1008-
StorageClass storageClass;
1009-
try {
1010-
storageClass = StorageClass.fromValue(storageClassConf);
1011-
} catch (IllegalArgumentException e) {
1012-
LOG.warn("Unknown storage class property {}: {}; falling back to default storage class",
1013-
STORAGE_CLASS, storageClassConf);
1014-
storageClass = null;
1008+
StorageClass storageClass = null;
1009+
if (!storageClassConf.isEmpty()) {
1010+
try {
1011+
storageClass = StorageClass.fromValue(storageClassConf);
1012+
} catch (IllegalArgumentException e) {
1013+
LOG.warn("Unknown storage class property {}: {}; falling back to default storage class",
1014+
STORAGE_CLASS, storageClassConf);
1015+
}
1016+
} else {
1017+
LOG.debug("Unset storage class property {}; falling back to default storage class",
1018+
STORAGE_CLASS);
10151019
}
10161020

10171021
return RequestFactoryImpl.builder()

0 commit comments

Comments
 (0)