felipecrv commented on code in PR #39450:
URL: https://github.com/apache/arrow/pull/39450#discussion_r1442385924
##########
cpp/src/arrow/filesystem/azurefs.h:
##########
@@ -92,30 +107,30 @@ struct ARROW_EXPORT AzureOptions {
private:
enum class CredentialKind {
+ kDefault,
kAnonymous,
- kTokenCredential,
- kStorageSharedKeyCredential,
- } credential_kind_ = CredentialKind::kAnonymous;
+ kStorageSharedKey,
+ kClientSecret,
+ kManagedIdentity,
+ kWorkloadIdentity,
+ } credential_kind_ = CredentialKind::kDefault;
- std::shared_ptr<Azure::Core::Credentials::TokenCredential> token_credential_;
std::shared_ptr<Azure::Storage::StorageSharedKeyCredential>
storage_shared_key_credential_;
+ mutable std::shared_ptr<Azure::Core::Credentials::TokenCredential>
token_credential_;
Review Comment:
Creating `DefaultAzureCredential` is a lot of non-trivial work: env vars,
multiple allocations and probes. We can't assume it to be a cheap operation.
`mutable` is a common solution to lazily-initialized class members and this one
has a very well-defined behavior: it's set once, then it doesn't change at all
anymore.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]