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

View File

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