HADOOP-18371. S3A FS init to log at debug when fs.s3a.create.storage.class is unset (#4730)

Contributed By: Viraj Jasani
This commit is contained in:
Viraj Jasani 2022-08-15 15:25:58 -07:00 committed by Mukund Thakur
parent 3b3bd89084
commit e8a28dc0d7
1 changed files with 11 additions and 7 deletions

View File

@ -1005,13 +1005,17 @@ public class S3AFileSystem extends FileSystem implements StreamCapabilities,
String storageClassConf = getConf()
.getTrimmed(STORAGE_CLASS, "")
.toUpperCase(Locale.US);
StorageClass storageClass;
try {
storageClass = StorageClass.fromValue(storageClassConf);
} catch (IllegalArgumentException e) {
LOG.warn("Unknown storage class property {}: {}; falling back to default storage class",
STORAGE_CLASS, storageClassConf);
storageClass = null;
StorageClass storageClass = null;
if (!storageClassConf.isEmpty()) {
try {
storageClass = StorageClass.fromValue(storageClassConf);
} catch (IllegalArgumentException e) {
LOG.warn("Unknown storage class property {}: {}; falling back to default storage class",
STORAGE_CLASS, storageClassConf);
}
} else {
LOG.debug("Unset storage class property {}; falling back to default storage class",
STORAGE_CLASS);
}
return RequestFactoryImpl.builder()