lordgamez commented on a change in pull request #1178:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1178#discussion_r719173632
##########
File path: extensions/azure/storage/AzureBlobStorage.cpp
##########
@@ -23,61 +23,39 @@
#include <memory>
#include <utility>
-namespace org {
-namespace apache {
-namespace nifi {
-namespace minifi {
-namespace azure {
-namespace storage {
+#include "azure/identity.hpp"
+#include "AzureBlobStorageClient.h"
-AzureBlobStorage::AzureBlobStorage(std::string connection_string, std::string
container_name)
- : BlobStorage(std::move(connection_string), std::move(container_name))
- ,
container_client_(std::make_unique<Azure::Storage::Blobs::BlobContainerClient>(
-
Azure::Storage::Blobs::BlobContainerClient::CreateFromConnectionString(connection_string_,
container_name_))) {
-}
+namespace org::apache::nifi::minifi::azure::storage {
-void AzureBlobStorage::resetClientIfNeeded(const std::string
&connection_string, const std::string &container_name) {
- if (connection_string == connection_string_ && container_name_ ==
container_name) {
- logger_->log_debug("Client credentials have not changed, no need to reset
client");
- return;
- }
- connection_string_ = connection_string;
- container_name_ = container_name;
- logger_->log_debug("Client has been reset with new credentials");
- container_client_ =
std::make_unique<Azure::Storage::Blobs::BlobContainerClient>(Azure::Storage::Blobs::BlobContainerClient::CreateFromConnectionString(connection_string,
container_name));
+AzureBlobStorage::AzureBlobStorage(std::unique_ptr<BlobStorageClient>
blob_storage_client)
+ : blob_storage_client_(blob_storage_client ? std::move(blob_storage_client)
: std::make_unique<AzureBlobStorageClient>()) {
}
-void AzureBlobStorage::createContainer() {
+std::optional<bool> AzureBlobStorage::createContainerIfNotExists(const
PutAzureBlobStorageParameters& params) {
Review comment:
Currently we only care if there was an error or not while trying to
create the container, but I would keep the possibility to check if the
container already existed or not if we want to differentiate later.
--
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]