szaszm commented on a change in pull request #1221:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1221#discussion_r783107526
##########
File path: extensions/azure/storage/AzureDataLakeStorageClient.cpp
##########
@@ -30,30 +34,35 @@ AzureDataLakeStorageClient::AzureDataLakeStorageClient() {
utils::AzureSdkLogger::initialize();
}
-void AzureDataLakeStorageClient::resetClientIfNeeded(const
AzureStorageCredentials& credentials, const std::string& file_system_name) {
- if (client_ && credentials_ == credentials && file_system_name_ ==
file_system_name) {
+void AzureDataLakeStorageClient::resetClientIfNeeded(const
AzureStorageCredentials& credentials, const std::string& file_system_name,
std::optional<uint64_t> number_of_retries) {
+ if (client_ && credentials_ == credentials && file_system_name_ ==
file_system_name && number_of_retries_ == number_of_retries) {
logger_->log_debug("Azure Data Lake Storge client credentials have not
changed, no need to reset client");
return;
}
+ Azure::Storage::Files::DataLake::DataLakeClientOptions options;
+ if (number_of_retries) {
+ options.Retry.MaxRetries = *number_of_retries;
+ }
+
if (credentials.getUseManagedIdentityCredentials()) {
auto datalake_service_client =
Azure::Storage::Files::DataLake::DataLakeServiceClient(
- "https://" + credentials.getStorageAccountName() + ".dfs." +
credentials.getEndpointSuffix(),
std::make_shared<Azure::Identity::ManagedIdentityCredential>());
-
+ "https://" + credentials.getStorageAccountName() + ".dfs." +
credentials.getEndpointSuffix(),
std::make_shared<Azure::Identity::ManagedIdentityCredential>(), options);
client_ =
std::make_unique<Azure::Storage::Files::DataLake::DataLakeFileSystemClient>(datalake_service_client.GetFileSystemClient(file_system_name));
logger_->log_debug("Azure Data Lake Storge client has been reset with new
managed identity credentials.");
} else {
client_ =
std::make_unique<Azure::Storage::Files::DataLake::DataLakeFileSystemClient>(
-
Azure::Storage::Files::DataLake::DataLakeFileSystemClient::CreateFromConnectionString(credentials.buildConnectionString(),
file_system_name));
+
Azure::Storage::Files::DataLake::DataLakeFileSystemClient::CreateFromConnectionString(credentials.buildConnectionString(),
file_system_name, options));
Review comment:
Continuation indentation should be 4 spaces.
```suggestion
Azure::Storage::Files::DataLake::DataLakeFileSystemClient::CreateFromConnectionString(credentials.buildConnectionString(),
file_system_name, options));
```
##########
File path: extensions/azure/storage/AzureDataLakeStorageClient.cpp
##########
@@ -30,30 +34,35 @@ AzureDataLakeStorageClient::AzureDataLakeStorageClient() {
utils::AzureSdkLogger::initialize();
}
-void AzureDataLakeStorageClient::resetClientIfNeeded(const
AzureStorageCredentials& credentials, const std::string& file_system_name) {
- if (client_ && credentials_ == credentials && file_system_name_ ==
file_system_name) {
+void AzureDataLakeStorageClient::resetClientIfNeeded(const
AzureStorageCredentials& credentials, const std::string& file_system_name,
std::optional<uint64_t> number_of_retries) {
+ if (client_ && credentials_ == credentials && file_system_name_ ==
file_system_name && number_of_retries_ == number_of_retries) {
logger_->log_debug("Azure Data Lake Storge client credentials have not
changed, no need to reset client");
return;
}
+ Azure::Storage::Files::DataLake::DataLakeClientOptions options;
+ if (number_of_retries) {
+ options.Retry.MaxRetries = *number_of_retries;
+ }
+
if (credentials.getUseManagedIdentityCredentials()) {
auto datalake_service_client =
Azure::Storage::Files::DataLake::DataLakeServiceClient(
- "https://" + credentials.getStorageAccountName() + ".dfs." +
credentials.getEndpointSuffix(),
std::make_shared<Azure::Identity::ManagedIdentityCredential>());
-
+ "https://" + credentials.getStorageAccountName() + ".dfs." +
credentials.getEndpointSuffix(),
std::make_shared<Azure::Identity::ManagedIdentityCredential>(), options);
Review comment:
same here
--
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]