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 GitHub
parent 622ca0d51f
commit d55d76e1e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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()