-
Notifications
You must be signed in to change notification settings - Fork 3.5k
add intelligent tiering storage class #3032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||||
| /* | ||||||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||
| * you may not use this file except in compliance with the License. | ||||||||
| * You may obtain a copy of the License at | ||||||||
| * | ||||||||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||||||||
| * | ||||||||
| * Unless required by applicable law or agreed to in writing, software | ||||||||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||||||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||||
| * See the License for the specific language governing permissions and | ||||||||
| * limitations under the License. | ||||||||
| */ | ||||||||
| package io.prestosql.plugin.hive.s3; | ||||||||
|
|
||||||||
| import com.amazonaws.services.s3.model.StorageClass; | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Praveen2112 These statement below might look confusing if I import the storage classes Should I still change this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #2686 (comment) -- ie do not import them |
||||||||
|
|
||||||||
| import static java.util.Objects.requireNonNull; | ||||||||
|
|
||||||||
| public enum PrestoS3StorageClass { | ||||||||
| STANDARD(StorageClass.Standard), | ||||||||
| INTELLIGENT_TIERING(StorageClass.IntelligentTiering); | ||||||||
|
|
||||||||
| private StorageClass s3StorageClass; | ||||||||
|
|
||||||||
| PrestoS3StorageClass(StorageClass s3StorageClass) | ||||||||
| { | ||||||||
| this.s3StorageClass = requireNonNull(s3StorageClass, "s3StorageClass is null"); | ||||||||
| } | ||||||||
|
|
||||||||
| public StorageClass getS3StorageClass() | ||||||||
| { | ||||||||
| return s3StorageClass; | ||||||||
| } | ||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,7 @@ public void testDefaults() | |
| .setS3PathStyleAccess(false) | ||
| .setS3UseInstanceCredentials(true) | ||
| .setS3IamRole(null) | ||
| .setS3StorageClass(PrestoS3StorageClass.STANDARD) | ||
| .setS3SslEnabled(true) | ||
| .setS3SseEnabled(false) | ||
| .setS3SseType(PrestoS3SseType.S3) | ||
|
|
@@ -77,6 +78,7 @@ public void testExplicitPropertyMappings() | |
| .put("hive.s3.path-style-access", "true") | ||
| .put("hive.s3.use-instance-credentials", "false") | ||
| .put("hive.s3.iam-role", "roleArn") | ||
| .put("hive.s3.storage-class", "INTELLIGENT_TIERING") | ||
| .put("hive.s3.ssl.enabled", "false") | ||
| .put("hive.s3.sse.enabled", "true") | ||
| .put("hive.s3.sse.type", "KMS") | ||
|
|
@@ -109,6 +111,7 @@ public void testExplicitPropertyMappings() | |
| .setS3PathStyleAccess(true) | ||
| .setS3UseInstanceCredentials(false) | ||
| .setS3IamRole("roleArn") | ||
| .setS3StorageClass(PrestoS3StorageClass.INTELLIGENT_TIERING) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we can import the enum directly
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Praveen2112 Importing Enum directly might look off since |
||
| .setS3SslEnabled(false) | ||
| .setS3SseEnabled(true) | ||
| .setS3SseType(PrestoS3SseType.KMS) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we directly import the enum ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Praveen2112 Importing Enum directly might look off since PrestoS3SignerType and PrestoS3AclType are used without importing Enum directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if static import removes readability, it's should not be used;
here it is OK to static import, except it would be inconsistent. Please keep as is (inconsistency decreases readability)