Repository navigation
Make the AbfsVendedTokenProvider support token renewal automatically - #1109
Conversation
f15f299 to
bffdfae
Compare
Signed-off-by: Zheng Hu <[email protected]>
bffdfae to
c05835c
Compare
Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: Zheng Hu <[email protected]>
| public GenericCredentialProvider() { | ||
| } | ||
|
|
||
| protected void initialize(Configuration conf) { |
There was a problem hiding this comment.
Since the azure don't allow the new X(conf) constructor to initialize the token provider instance, it just use the new X() constructor , and then use the x.initialize(conf) to do the initialization.
So here I made the constructor and initialaztion into two steps for the GenericCredentialProvider
- no arg constructor, to new the constructor.
initialize(conf)to initialze the fields.
For the AwsVendedTokenProvider, it only allows the new X(conf) to initialize the constructor. Then it should be simple, since we can call new X() then call initialize(conf) inside the constructor.
|
|
||
| public class AbfsVendedTokenProvider implements SASTokenProvider { | ||
| private Configuration conf; | ||
| protected static final String ACCESS_TOKEN_KEY = "fs.azure.sas.fixed.token"; |
There was a problem hiding this comment.
This key is removed in this PR, since we will turn to this newly key: https://github.com/unitycatalog/unitycatalog/pull/1109/files#diff-e53d40cc08a4f4120bad08ea094a311a2e36c689b044767bc02a956e78920293R15
| @Override | ||
| public void initialize(Configuration configuration, String accountName) throws IOException { | ||
| this.conf = configuration; | ||
| } |
There was a problem hiding this comment.
what was this class used for before. do you know?
|
|
||
| @Test | ||
| public void testGlobalCredCache() throws Exception { | ||
| Configuration confA = newTableBasedConf("tableA"); |
There was a problem hiding this comment.
reminder that you can address my comments in this PR
#1108 (comment)
There was a problem hiding this comment.
Thanks for the reminder, I think this PR is the good place to address your comment. Let me do that in this PR.
| UCHadoopConf.AZURE_INIT_SAS_TOKEN -> azCredentials.getSasToken, | ||
| UCHadoopConf.AZURE_INIT_SAS_TOKEN_EXPIRED_TIME -> String.valueOf( | ||
| temporaryCredentials.getExpirationTime), |
There was a problem hiding this comment.
as i said before, we should have a spark conf for controlling whether we use the original confs or init confs + provider. when we backport these to 0.3 branch, we will maintain the default to be original confs, but in 0.4 we will set the default to init conf + provider. But in both cases, the conf gives the user to change the behavior at will.
There was a problem hiding this comment.
Yes, agreed. Then let me revert this change here, since this part is integrating the AbfsVendedTokenProvider to the spark unity catalog. Let's keep this PR focus on the AbfsVendedTokenProvider implementation, and for the next AbfsVendedTokenProvider integration test, let's do the work as you mentioned, which I think will need some flag to control whether if we need to enable the renewal provider or not here https://github.com/unitycatalog/unitycatalog/pull/1110/files#diff-d0fc1c1f6daf86a09832cfab469663dbb46d8846f4041f41d329954ede8d31b6R19 (this is the aws version, will have another abfs integration version).
tdas
left a comment
There was a problem hiding this comment.
one main comment about integration with UCSIngleCatalog.
Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: Zheng Hu <[email protected]>
|
LGTM.. .but what about this past comment? |
Signed-off-by: Zheng Hu <[email protected]>
…nitycatalog#1109) **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [x] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [x] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** Solve this issue: unitycatalog#1106 --------- Signed-off-by: Zheng Hu <[email protected]> Signed-off-by: TimothyW553 <[email protected]>
…cally (unitycatalog#1109) **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [x] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [x] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** Solve this issue: unitycatalog#1106 --------- Signed-off-by: Zheng Hu <[email protected]>
…cally (#1109) (#1184) **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [x] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [x] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** Backport the #1109 to branch-0.3 Signed-off-by: Zheng Hu <[email protected]>
PR Checklist
docsis updatedDescription of changes
Solve this issue: #1106