steveloughran commented on code in PR #3877: URL: https://github.com/apache/hadoop/pull/3877#discussion_r865894994
########## hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/index.md: ########## @@ -1671,6 +1671,25 @@ To enable this feature within S3A, configure the `fs.s3a.requester.pays.enabled` </property> ``` +## <a name="storage_classes"></a>Storage Classes + +Amazon S3 offers a range of [Storage Classes](https://aws.amazon.com/s3/storage-classes/) +that you can choose from based on behavior of your applications. By using the right +storage class, you can reduce the cost of your bucket. + +S3A uses Standard storage class for PUT object requests by default, which is suitable for +general use cases. To use a specific storage class, set the value in `fs.s3a.storage.class` property to +the storage class you want. + +```xml +<property> + <name>fs.s3a.storage.class</name> + <value>intelligent_tiering</value> +</property> +``` + +Please note that S3A does not support reading from archive storage classes at the moment. Review Comment: can you add that if someone tries this, they will get access denied with InvalidObjectState. or add the error/trace to the troubleshooting section where the other exceptions are. ########## hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java: ########## @@ -963,7 +965,15 @@ protected RequestFactory createRequestFactory() { // Any encoding type String contentEncoding = getConf().getTrimmed(CONTENT_ENCODING, null); - String storageClass = getConf().getTrimmed(STORAGE_CLASS, null); + StorageClass storageClass; + try { + String storageClassConf = getConf() + .getTrimmed(STORAGE_CLASS, "") + .toUpperCase(Locale.US); + storageClass = StorageClass.fromValue(storageClassConf); + } catch (IllegalArgumentException e) { + storageClass = null; Review Comment: good q here. i wonder what to do. I would recommend logging at info/warn on the unknown value and then continuing. so the try/catch would only surround line 973 and log the value of storageClassConf in the error. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org