HADOOP-19805. When creating a signer, if it is Configurable, set its …#8305
Open
deepujain wants to merge 4 commits intoapache:trunkfrom
Open
HADOOP-19805. When creating a signer, if it is Configurable, set its …#8305deepujain wants to merge 4 commits intoapache:trunkfrom
deepujain wants to merge 4 commits intoapache:trunkfrom
Conversation
…config. In createHttpSigner, call setConf(conf) when the HTTP signer implements Configurable; use getDeclaredConstructor().newInstance() and ReflectiveOperationException.
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In
SignerFactory.createHttpSigner, the HTTP signer instance was created via reflection butConfigurationwas never passed to it. If the signer implements Hadoop'sConfigurableinterface, it should receive the configuration viasetConf(conf)so it can use config keys (e.g. custom signing options). This alignscreateHttpSignerwith the existing behavior increateSigner, which already callssetConfwhen the signer isConfigurable.Change
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/SignerFactory.javacreateHttpSigner: after instantiating the HTTP signer, if the instance isConfigurable, callsetConf(conf)before wrapping it in the auth scheme.getDeclaredConstructor().newInstance()instead of deprecatedclazz.newInstance(); catchReflectiveOperationExceptionfor reflection failures.Why no new tests
Aligns
createHttpSignerwith existingcreateSignerbehavior; no new logic beyond callingsetConfwhen the signer isConfigurable. Existing S3A auth and signing tests exercise the factory. Manual verification: confirmed custom Configurable signer receives configuration.JIRA
Fixes HADOOP-19805