diff --git a/sdk/storage/inc/blobs/blob_options.hpp b/sdk/storage/inc/blobs/blob_options.hpp index 4c8c5ebc5..f8bd0a59a 100644 --- a/sdk/storage/inc/blobs/blob_options.hpp +++ b/sdk/storage/inc/blobs/blob_options.hpp @@ -869,9 +869,9 @@ namespace Azure { namespace Storage { namespace Blobs { }; /** - * @brief Optional parameters for BlockBlobClient::UploadFromBuffer. + * @brief Optional parameters for BlockBlobClient::UploadFrom. */ - struct ConcurrentUploadBlockBlobFromBufferOptions + struct UploadBlockBlobFromOptions { /** * @brief Context for cancelling long running operations. @@ -904,8 +904,6 @@ namespace Azure { namespace Storage { namespace Blobs { int Concurrency = 1; }; - using ConcurrentUploadBlockBlobFromFileOptions = ConcurrentUploadBlockBlobFromBufferOptions; - /** * @brief Optional parameters for BlockBlobClient::StageBlock. */ @@ -985,7 +983,7 @@ namespace Azure { namespace Storage { namespace Blobs { /** * @brief Optional parameters for BlockBlobClient::CommitBlockList. */ - struct CommitBlobBlockListOptions + struct CommitBlockListOptions { /** * @brief Context for cancelling long running operations. @@ -1016,7 +1014,7 @@ namespace Azure { namespace Storage { namespace Blobs { /** * @brief Optional parameters for BlockBlobClient::GetBlockList. */ - struct GetBlobBlockListOptions + struct GetBlockListOptions { /** * @brief Context for cancelling long running operations. diff --git a/sdk/storage/inc/blobs/blob_responses.hpp b/sdk/storage/inc/blobs/blob_responses.hpp index f38c4713a..fa3d51a2c 100644 --- a/sdk/storage/inc/blobs/blob_responses.hpp +++ b/sdk/storage/inc/blobs/blob_responses.hpp @@ -25,8 +25,7 @@ namespace Azure { namespace Storage { namespace Blobs { Azure::Core::Nullable EncryptionKeySha256; }; - using UploadBlockBlobFromBufferResult = UploadBlockBlobResult; - using UploadBlockBlobFromFileResult = UploadBlockBlobResult; + using UploadBlockBlobFromResult = UploadBlockBlobResult; struct PageRange { diff --git a/sdk/storage/inc/blobs/block_blob_client.hpp b/sdk/storage/inc/blobs/block_blob_client.hpp index 97b20e620..35d71c7ad 100644 --- a/sdk/storage/inc/blobs/block_blob_client.hpp +++ b/sdk/storage/inc/blobs/block_blob_client.hpp @@ -135,13 +135,12 @@ namespace Azure { namespace Storage { namespace Blobs { * @param buffer A memory buffer containing the content to upload. * @param bufferSize Size of the memory buffer. * @param options Optional parameters to execute this function. - * @return A UploadBlockBlobFromBufferResult describing the state of the updated block blob. + * @return A UploadBlockBlobFromResult describing the state of the updated block blob. */ - Azure::Core::Response UploadFromBuffer( + Azure::Core::Response UploadFrom( const uint8_t* buffer, std::size_t bufferSize, - const ConcurrentUploadBlockBlobFromBufferOptions& options - = ConcurrentUploadBlockBlobFromBufferOptions()) const; + const UploadBlockBlobFromOptions& options = UploadBlockBlobFromOptions()) const; /** * @brief Creates a new block blob, or updates the content of an existing block blob. Updating @@ -149,13 +148,11 @@ namespace Azure { namespace Storage { namespace Blobs { * * @param file A file containing the content to upload. * @param options Optional parameters to execute this function. - * @return A ConcurrentUploadBlockBlobFromFileOptions describing the state of the updated block - * blob. + * @return A UploadBlockBlobFromResult describing the state of the updated block blob. */ - Azure::Core::Response UploadFromFile( + Azure::Core::Response UploadFrom( const std::string& file, - const ConcurrentUploadBlockBlobFromFileOptions& options - = ConcurrentUploadBlockBlobFromFileOptions()) const; + const UploadBlockBlobFromOptions& options = UploadBlockBlobFromOptions()) const; /** * @brief Creates a new block as part of a block blob's staging area to be eventually @@ -203,9 +200,9 @@ namespace Azure { namespace Storage { namespace Blobs { * @param options Optional parameters to execute this function. * @return A CommitBlobBlockListResult describing the state of the updated block blob. */ - Azure::Core::Response CommitBlockList( + Azure::Core::Response CommitBlockList( const std::vector>& blockIds, - const CommitBlobBlockListOptions& options = CommitBlobBlockListOptions()) const; + const CommitBlockListOptions& options = CommitBlockListOptions()) const; /** * @brief Retrieves the list of blocks that have been uploaded as part of a block blob. There @@ -217,8 +214,8 @@ namespace Azure { namespace Storage { namespace Blobs { * @param options Optional parameters to execute this function. * @return A GetBlobBlockListResult describing requested block list. */ - Azure::Core::Response GetBlockList( - const GetBlobBlockListOptions& options = GetBlobBlockListOptions()) const; + Azure::Core::Response GetBlockList( + const GetBlockListOptions& options = GetBlockListOptions()) const; private: explicit BlockBlobClient(BlobClient blobClient); diff --git a/sdk/storage/inc/blobs/protocol/blob_rest_client.hpp b/sdk/storage/inc/blobs/protocol/blob_rest_client.hpp index 8ecc3f4c0..e349d5ebe 100644 --- a/sdk/storage/inc/blobs/protocol/blob_rest_client.hpp +++ b/sdk/storage/inc/blobs/protocol/blob_rest_client.hpp @@ -664,7 +664,7 @@ namespace Azure { namespace Storage { namespace Blobs { Azure::Core::Nullable EncryptionScope; }; // struct ClearPageBlobPagesResult - struct CommitBlobBlockListResult + struct CommitBlockListResult { std::string ETag; std::string LastModified; @@ -675,7 +675,7 @@ namespace Azure { namespace Storage { namespace Blobs { Azure::Core::Nullable ServerEncrypted; Azure::Core::Nullable EncryptionKeySha256; Azure::Core::Nullable EncryptionScope; - }; // struct CommitBlobBlockListResult + }; // struct CommitBlockListResult enum class CopyStatus { @@ -1370,16 +1370,6 @@ namespace Azure { namespace Storage { namespace Blobs { Blobs::AccountKind AccountKind = Blobs::AccountKind::Unknown; }; // struct GetAccountInfoResult - struct GetBlobBlockListResult - { - std::string ETag; - std::string LastModified; - std::string ContentType; - int64_t ContentLength = 0; - std::vector CommittedBlocks; - std::vector UncommittedBlocks; - }; // struct GetBlobBlockListResult - struct GetBlobPropertiesResult { std::string ETag; @@ -1408,6 +1398,16 @@ namespace Azure { namespace Storage { namespace Blobs { Azure::Core::Nullable CopyCompletionTime; }; // struct GetBlobPropertiesResult + struct GetBlockListResult + { + std::string ETag; + std::string LastModified; + std::string ContentType; + int64_t ContentLength = 0; + std::vector CommittedBlocks; + std::vector UncommittedBlocks; + }; // struct GetBlockListResult + struct GetContainerAccessPolicyResult { PublicAccessType AccessType = PublicAccessType::Private; @@ -6312,7 +6312,7 @@ namespace Azure { namespace Storage { namespace Blobs { std::move(response), std::move(pHttpResponse)); } - struct CommitBlobBlockListOptions + struct CommitBlockListOptions { Azure::Core::Nullable Timeout; std::vector> BlockList; @@ -6328,19 +6328,19 @@ namespace Azure { namespace Storage { namespace Blobs { Azure::Core::Nullable IfMatch; Azure::Core::Nullable IfNoneMatch; Azure::Core::Nullable Tier; - }; // struct CommitBlobBlockListOptions + }; // struct CommitBlockListOptions - static Azure::Core::Response CommitBlockList( + static Azure::Core::Response CommitBlockList( const Azure::Core::Context& context, Azure::Core::Http::HttpPipeline& pipeline, const std::string& url, - const CommitBlobBlockListOptions& options) + const CommitBlockListOptions& options) { unused(options); std::string xml_body; { XmlWriter writer; - CommitBlobBlockListOptionsToXml(writer, options); + CommitBlockListOptionsToXml(writer, options); xml_body = writer.GetDocument(); writer.Write(XmlNode{XmlNodeType::End}); } @@ -6438,7 +6438,7 @@ namespace Azure { namespace Storage { namespace Blobs { } auto pHttpResponse = pipeline.Send(context, request); Azure::Core::Http::RawResponse& httpResponse = *pHttpResponse; - CommitBlobBlockListResult response; + CommitBlockListResult response; auto http_status_code = static_cast::type>( httpResponse.GetStatusCode()); @@ -6471,22 +6471,22 @@ namespace Azure { namespace Storage { namespace Blobs { { response.EncryptionScope = response_encryption_scope_iterator->second; } - return Azure::Core::Response( + return Azure::Core::Response( std::move(response), std::move(pHttpResponse)); } - struct GetBlobBlockListOptions + struct GetBlockListOptions { Azure::Core::Nullable Timeout; Azure::Core::Nullable ListType; Azure::Core::Nullable LeaseId; - }; // struct GetBlobBlockListOptions + }; // struct GetBlockListOptions - static Azure::Core::Response GetBlockList( + static Azure::Core::Response GetBlockList( const Azure::Core::Context& context, Azure::Core::Http::HttpPipeline& pipeline, const std::string& url, - const GetBlobBlockListOptions& options) + const GetBlockListOptions& options) { unused(options); auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, url); @@ -6508,7 +6508,7 @@ namespace Azure { namespace Storage { namespace Blobs { } auto pHttpResponse = pipeline.Send(context, request); Azure::Core::Http::RawResponse& httpResponse = *pHttpResponse; - GetBlobBlockListResult response; + GetBlockListResult response; auto http_status_code = static_cast::type>( httpResponse.GetStatusCode()); @@ -6520,21 +6520,21 @@ namespace Azure { namespace Storage { namespace Blobs { const auto& httpResponseBody = httpResponse.GetBody(); XmlReader reader( reinterpret_cast(httpResponseBody.data()), httpResponseBody.size()); - response = GetBlobBlockListResultFromXml(reader); + response = GetBlockListResultFromXml(reader); } response.ETag = httpResponse.GetHeaders().at("etag"); response.LastModified = httpResponse.GetHeaders().at("last-modified"); response.ContentType = httpResponse.GetHeaders().at("content-type"); response.ContentLength = std::stoll(httpResponse.GetHeaders().at("x-ms-blob-content-length")); - return Azure::Core::Response( + return Azure::Core::Response( std::move(response), std::move(pHttpResponse)); } private: - static GetBlobBlockListResult GetBlobBlockListResultFromXml(XmlReader& reader) + static GetBlockListResult GetBlockListResultFromXml(XmlReader& reader) { - GetBlobBlockListResult ret; + GetBlockListResult ret; enum class XmlTagName { k_BlockList, @@ -6663,9 +6663,9 @@ namespace Azure { namespace Storage { namespace Blobs { return ret; } - static void CommitBlobBlockListOptionsToXml( + static void CommitBlockListOptionsToXml( XmlWriter& writer, - const CommitBlobBlockListOptions& options) + const CommitBlockListOptions& options) { writer.Write(XmlNode{XmlNodeType::StartTag, "BlockList"}); for (const auto& i : options.BlockList) diff --git a/sdk/storage/sample/blob_getting_started.cpp b/sdk/storage/sample/blob_getting_started.cpp index 19cbc9e7c..4b7a054c3 100644 --- a/sdk/storage/sample/blob_getting_started.cpp +++ b/sdk/storage/sample/blob_getting_started.cpp @@ -29,8 +29,7 @@ void BlobsGettingStarted() BlockBlobClient blobClient = containerClient.GetBlockBlobClient(blobName); - blobClient.UploadFromBuffer( - reinterpret_cast(blobContent.data()), blobContent.size()); + blobClient.UploadFrom(reinterpret_cast(blobContent.data()), blobContent.size()); std::map blobMetadata = {{"key1", "value1"}, {"key2", "value2"}}; blobClient.SetMetadata(blobMetadata); diff --git a/sdk/storage/src/blobs/block_blob_client.cpp b/sdk/storage/src/blobs/block_blob_client.cpp index 33324ae1e..47ccda067 100644 --- a/sdk/storage/src/blobs/block_blob_client.cpp +++ b/sdk/storage/src/blobs/block_blob_client.cpp @@ -101,10 +101,10 @@ namespace Azure { namespace Storage { namespace Blobs { options.Context, *m_pipeline, m_blobUrl.ToString(), content, protocolLayerOptions); } - Azure::Core::Response BlockBlobClient::UploadFromBuffer( + Azure::Core::Response BlockBlobClient::UploadFrom( const uint8_t* buffer, std::size_t bufferSize, - const ConcurrentUploadBlockBlobFromBufferOptions& options) const + const UploadBlockBlobFromOptions& options) const { constexpr int64_t c_defaultBlockSize = 8 * 1024 * 1024; constexpr int64_t c_maximumNumberBlocks = 50000; @@ -159,29 +159,29 @@ namespace Azure { namespace Storage { namespace Blobs { blockIds[i].first = BlockType::Uncommitted; blockIds[i].second = getBlockId(static_cast(i)); } - CommitBlobBlockListOptions commitBlockListOptions; + CommitBlockListOptions commitBlockListOptions; commitBlockListOptions.Context = options.Context; commitBlockListOptions.HttpHeaders = options.HttpHeaders; commitBlockListOptions.Metadata = options.Metadata; commitBlockListOptions.Tier = options.Tier; auto commitBlockListResponse = CommitBlockList(blockIds, commitBlockListOptions); - UploadBlockBlobFromBufferResult ret; + UploadBlockBlobFromResult ret; ret.ETag = std::move(commitBlockListResponse->ETag); ret.LastModified = std::move(commitBlockListResponse->LastModified); ret.VersionId = std::move(commitBlockListResponse->VersionId); ret.ServerEncrypted = commitBlockListResponse->ServerEncrypted; ret.EncryptionKeySha256 = std::move(commitBlockListResponse->EncryptionKeySha256); ret.EncryptionScope = std::move(commitBlockListResponse->EncryptionScope); - return Azure::Core::Response( + return Azure::Core::Response( std::move(ret), std::make_unique( std::move(commitBlockListResponse.GetRawResponse()))); } - Azure::Core::Response BlockBlobClient::UploadFromFile( + Azure::Core::Response BlockBlobClient::UploadFrom( const std::string& file, - const ConcurrentUploadBlockBlobFromFileOptions& options) const + const UploadBlockBlobFromOptions& options) const { constexpr int64_t c_defaultBlockSize = 8 * 1024 * 1024; constexpr int64_t c_maximumNumberBlocks = 50000; @@ -241,21 +241,21 @@ namespace Azure { namespace Storage { namespace Blobs { blockIds[i].first = BlockType::Uncommitted; blockIds[i].second = getBlockId(static_cast(i)); } - CommitBlobBlockListOptions commitBlockListOptions; + CommitBlockListOptions commitBlockListOptions; commitBlockListOptions.Context = options.Context; commitBlockListOptions.HttpHeaders = options.HttpHeaders; commitBlockListOptions.Metadata = options.Metadata; commitBlockListOptions.Tier = options.Tier; auto commitBlockListResponse = CommitBlockList(blockIds, commitBlockListOptions); - UploadBlockBlobFromBufferResult result; + UploadBlockBlobFromResult result; result.ETag = commitBlockListResponse->ETag; result.LastModified = commitBlockListResponse->LastModified; result.VersionId = commitBlockListResponse->VersionId; result.ServerEncrypted = commitBlockListResponse->ServerEncrypted; result.EncryptionKeySha256 = commitBlockListResponse->EncryptionKeySha256; result.EncryptionScope = commitBlockListResponse->EncryptionScope; - return Azure::Core::Response( + return Azure::Core::Response( std::move(result), std::make_unique( std::move(commitBlockListResponse.GetRawResponse()))); @@ -321,11 +321,11 @@ namespace Azure { namespace Storage { namespace Blobs { options.Context, *m_pipeline, m_blobUrl.ToString(), protocolLayerOptions); } - Azure::Core::Response BlockBlobClient::CommitBlockList( + Azure::Core::Response BlockBlobClient::CommitBlockList( const std::vector>& blockIds, - const CommitBlobBlockListOptions& options) const + const CommitBlockListOptions& options) const { - BlobRestClient::BlockBlob::CommitBlobBlockListOptions protocolLayerOptions; + BlobRestClient::BlockBlob::CommitBlockListOptions protocolLayerOptions; protocolLayerOptions.BlockList = blockIds; protocolLayerOptions.HttpHeaders = options.HttpHeaders; protocolLayerOptions.Metadata = options.Metadata; @@ -346,10 +346,10 @@ namespace Azure { namespace Storage { namespace Blobs { options.Context, *m_pipeline, m_blobUrl.ToString(), protocolLayerOptions); } - Azure::Core::Response BlockBlobClient::GetBlockList( - const GetBlobBlockListOptions& options) const + Azure::Core::Response BlockBlobClient::GetBlockList( + const GetBlockListOptions& options) const { - BlobRestClient::BlockBlob::GetBlobBlockListOptions protocolLayerOptions; + BlobRestClient::BlockBlob::GetBlockListOptions protocolLayerOptions; protocolLayerOptions.ListType = options.ListType; protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId; return BlobRestClient::BlockBlob::GetBlockList( diff --git a/sdk/storage/src/datalake/datalake_file_client.cpp b/sdk/storage/src/datalake/datalake_file_client.cpp index 2004c9f62..dc02be0ad 100644 --- a/sdk/storage/src/datalake/datalake_file_client.cpp +++ b/sdk/storage/src/datalake/datalake_file_client.cpp @@ -327,13 +327,13 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { const std::string& file, const UploadFileOptions& options) const { - Blobs::ConcurrentUploadBlockBlobFromBufferOptions blobOptions; + Blobs::UploadBlockBlobFromOptions blobOptions; blobOptions.Context = options.Context; blobOptions.ChunkSize = options.ChunkSize; blobOptions.HttpHeaders = FromDataLakeHttpHeaders(options.HttpHeaders); blobOptions.Metadata = options.Metadata; blobOptions.Concurrency = options.Concurrency; - return m_blockBlobClient.UploadFromFile(file, blobOptions); + return m_blockBlobClient.UploadFrom(file, blobOptions); } Azure::Core::Response FileClient::UploadFromBuffer( @@ -341,13 +341,13 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { std::size_t bufferSize, const UploadFileOptions& options) const { - Blobs::ConcurrentUploadBlockBlobFromBufferOptions blobOptions; + Blobs::UploadBlockBlobFromOptions blobOptions; blobOptions.Context = options.Context; blobOptions.ChunkSize = options.ChunkSize; blobOptions.HttpHeaders = FromDataLakeHttpHeaders(options.HttpHeaders); blobOptions.Metadata = options.Metadata; blobOptions.Concurrency = options.Concurrency; - return m_blockBlobClient.UploadFromBuffer(buffer, bufferSize, blobOptions); + return m_blockBlobClient.UploadFrom(buffer, bufferSize, blobOptions); } Azure::Core::Response FileClient::DownloadToBuffer( diff --git a/sdk/storage/test/blobs/blob_container_client_test.cpp b/sdk/storage/test/blobs/blob_container_client_test.cpp index f01e401a2..f515f5302 100644 --- a/sdk/storage/test/blobs/blob_container_client_test.cpp +++ b/sdk/storage/test/blobs/blob_container_client_test.cpp @@ -465,7 +465,7 @@ namespace Azure { namespace Storage { namespace Test { std::vector blobContent(512); Azure::Core::Http::MemoryBodyStream bodyStream(blobContent.data(), blobContent.size()); auto copySourceBlob = m_blobContainerClient->GetBlockBlobClient(RandomString()); - copySourceBlob.UploadFromBuffer(blobContent.data(), blobContent.size()); + copySourceBlob.UploadFrom(blobContent.data(), blobContent.size()); { std::string blockBlobName = RandomString(); diff --git a/sdk/storage/test/blobs/block_blob_client_test.cpp b/sdk/storage/test/blobs/block_blob_client_test.cpp index da3658520..7f04190e0 100644 --- a/sdk/storage/test/blobs/block_blob_client_test.cpp +++ b/sdk/storage/test/blobs/block_blob_client_test.cpp @@ -243,7 +243,7 @@ namespace Azure { namespace Storage { namespace Test { auto blockContent = Azure::Core::Http::MemoryBodyStream(block1Content.data(), block1Content.size()); blockBlobClient.StageBlock(blockId1, &blockContent); - Azure::Storage::Blobs::CommitBlobBlockListOptions options; + Azure::Storage::Blobs::CommitBlockListOptions options; options.HttpHeaders = m_blobUploadOptions.HttpHeaders; options.Metadata = m_blobUploadOptions.Metadata; auto blobContentInfo = blockBlobClient.CommitBlockList( @@ -265,7 +265,7 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_TRUE(res->UncommittedBlocks.empty()); blockBlobClient.StageBlockFromUri(blockId2, m_blockBlobClient->GetUri() + GetSas()); - Blobs::GetBlobBlockListOptions options2; + Blobs::GetBlockListOptions options2; options2.ListType = Blobs::BlockListTypeOption::All; res = blockBlobClient.GetBlockList(options2); EXPECT_EQ(res->ContentLength, static_cast(block1Content.size())); @@ -430,7 +430,7 @@ namespace Azure { namespace Storage { namespace Test { auto blockBlobClient = Azure::Storage::Blobs::BlockBlobClient::CreateFromConnectionString( StandardStorageConnectionString(), m_containerName, RandomString()); std::string emptyFilename = RandomString(); - EXPECT_THROW(blockBlobClient.UploadFromFile(emptyFilename), std::runtime_error); + EXPECT_THROW(blockBlobClient.UploadFrom(emptyFilename), std::runtime_error); EXPECT_THROW(blockBlobClient.Delete(), StorageError); } @@ -452,14 +452,14 @@ namespace Azure { namespace Storage { namespace Test { auto blockBlobClient = Azure::Storage::Blobs::BlockBlobClient::CreateFromConnectionString( StandardStorageConnectionString(), m_containerName, RandomString()); - blockBlobClient.UploadFromBuffer(emptyContent.data(), emptyContent.size()); + blockBlobClient.UploadFrom(emptyContent.data(), emptyContent.size()); EXPECT_NO_THROW(blockBlobClient.Delete()); std::string emptyFilename = RandomString(); { Details::FileWriter writer(emptyFilename); } - blockBlobClient.UploadFromFile(emptyFilename); + blockBlobClient.UploadFrom(emptyFilename); EXPECT_NO_THROW(blockBlobClient.Delete()); DeleteFile(emptyFilename); @@ -577,7 +577,7 @@ namespace Azure { namespace Storage { namespace Test { for (int64_t length : {0ULL, 1ULL, 2ULL, 2_KB, 4_KB, 999_KB, 1_MB, 2_MB - 1, 3_MB, 5_MB, 8_MB - 1234, 8_MB}) { - Azure::Storage::Blobs::ConcurrentUploadBlockBlobFromBufferOptions options; + Azure::Storage::Blobs::UploadBlockBlobFromOptions options; options.ChunkSize = 1_MB; options.Concurrency = c; options.HttpHeaders = m_blobUploadOptions.HttpHeaders; @@ -585,7 +585,7 @@ namespace Azure { namespace Storage { namespace Test { options.Metadata = m_blobUploadOptions.Metadata; options.Tier = m_blobUploadOptions.Tier; { - auto res = blockBlobClient.UploadFromBuffer( + auto res = blockBlobClient.UploadFrom( m_blobContent.data(), static_cast(length), options); EXPECT_FALSE(res->ETag.empty()); EXPECT_FALSE(res->LastModified.empty()); @@ -610,7 +610,7 @@ namespace Azure { namespace Storage { namespace Test { Azure::Storage::Details::FileWriter fileWriter(tempFilename); fileWriter.Write(m_blobContent.data(), length, 0); } - auto res = blockBlobClient.UploadFromFile(tempFilename, options); + auto res = blockBlobClient.UploadFrom(tempFilename, options); EXPECT_FALSE(res->ETag.empty()); EXPECT_FALSE(res->LastModified.empty()); EXPECT_FALSE(res->SequenceNumber.HasValue()); diff --git a/sdk/storage/test/blobs/large_scale_test.cpp b/sdk/storage/test/blobs/large_scale_test.cpp index 1eec861cd..68ac440d9 100644 --- a/sdk/storage/test/blobs/large_scale_test.cpp +++ b/sdk/storage/test/blobs/large_scale_test.cpp @@ -38,12 +38,12 @@ namespace Azure { namespace Storage { namespace Test { fileSize = static_cast(reader.GetFileSize()); } - Blobs::ConcurrentUploadBlockBlobFromFileOptions options; + Blobs::UploadBlockBlobFromOptions options; options.Concurrency = concurrency; auto timer_start = std::chrono::steady_clock::now(); try { - auto res = blockBlobClient.UploadFromFile(sourceFile, options); + auto res = blockBlobClient.UploadFrom(sourceFile, options); } catch (std::exception& e) { diff --git a/sdk/storage/test/blobs/performance_benchmark.cpp b/sdk/storage/test/blobs/performance_benchmark.cpp index b49bcd4f8..77596ff0a 100644 --- a/sdk/storage/test/blobs/performance_benchmark.cpp +++ b/sdk/storage/test/blobs/performance_benchmark.cpp @@ -17,10 +17,10 @@ namespace Azure { namespace Storage { namespace Test { constexpr std::size_t bufferSize = static_cast(1_GB); std::vector buffer = RandomBuffer(bufferSize); { - Blobs::ConcurrentUploadBlockBlobFromBufferOptions options; + Blobs::UploadBlockBlobFromOptions options; options.ChunkSize = 8_MB; auto timer_start = std::chrono::steady_clock::now(); - auto res = blockBlobClient.UploadFromBuffer(buffer.data(), buffer.size(), options); + auto res = blockBlobClient.UploadFrom(buffer.data(), buffer.size(), options); auto timer_end = std::chrono::steady_clock::now(); double speed = static_cast(bufferSize) / 1_MB @@ -61,15 +61,14 @@ namespace Azure { namespace Storage { namespace Test { { std::vector> futures; - Blobs::ConcurrentUploadBlockBlobFromBufferOptions options; + Blobs::UploadBlockBlobFromOptions options; options.ChunkSize = 8_MB; auto timer_start = std::chrono::steady_clock::now(); for (int i = 0; i < concurrency; ++i) { futures.emplace_back( std::async(std::launch::async, [&blockBlobClients, &buffer, &options, i]() { - auto res - = blockBlobClients[i].UploadFromBuffer(buffer.data(), buffer.size(), options); + auto res = blockBlobClients[i].UploadFrom(buffer.data(), buffer.size(), options); })); } for (auto& f : futures)