Skip to content

AWS: OSS S3 Signer Updates#6835

Merged
danielcweeks merged 1 commit into
apache:masterfrom
nastra:s3-signer-updates
Feb 20, 2023
Merged

AWS: OSS S3 Signer Updates#6835
danielcweeks merged 1 commit into
apache:masterfrom
nastra:s3-signer-updates

Conversation

@nastra

@nastra nastra commented Feb 14, 2023

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the AWS label Feb 14, 2023
}

private static SimpleModule initModule() {
public static SimpleModule initModule() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made public here and above so that it can be easier reused

@nastra nastra requested a review from danielcweeks February 14, 2023 05:17
@jackye1995 jackye1995 self-requested a review February 14, 2023 19:08
Comment thread aws/src/main/java/org/apache/iceberg/aws/s3/signer/S3ObjectMapper.java Outdated
Comment on lines 52 to 53
if (!isInitialized) {
synchronized (S3ObjectMapper.class) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I missed earlier but it's minor, generally for these kinds of initializations I think it's more clear to have an AtomicReference() and use the compareAndSet method if the instance is null.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is actually a good idea and I agree that we can improve this area. I opened #6857 to address that

Comment thread aws/src/main/java/org/apache/iceberg/aws/s3/signer/S3ObjectMapper.java Outdated
@nastra nastra closed this Feb 16, 2023
@nastra nastra reopened this Feb 16, 2023
@nastra nastra added this to the Iceberg 1.2.0 milestone Feb 16, 2023
* A token supplier that takes precedence over {@link S3V4RestSignerClient#token()} if it's set.
*/
@Nullable
public abstract Supplier<String> tokenSupplier();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like it's unnecessary to have both token() and tokenSupplier(). I think we should just make token() be a supplier and then the default can always be properties().get(OAuth2Properties.TOKEN. Having duplicates with precedence considerations just makes it more complicated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that makes a lot of sense. I've made those changes and pushed

@danielcweeks danielcweeks merged commit cd7bd16 into apache:master Feb 20, 2023
@nastra nastra deleted the s3-signer-updates branch February 20, 2023 18:22
krvikash pushed a commit to krvikash/iceberg that referenced this pull request Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants