diff --git a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md index 0095e1669..72d620a6f 100644 --- a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md @@ -9,6 +9,7 @@ ### Breaking Changes - Removed `GetDfsUri` in all clients since they are currently implementation details. +- Removed `Data` suffix for `FlushData` and `AppendData` and modified all related structs to align the change. - `DataLakePathClient` can no longer set permissions with `SetAccessControl`, instead, a new API `SetPermissions` is created for such functionality. Renamed the original API to `SetAccessControlList` to be more precise. - Renamed `GetUri` to `GetUrl`. diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_client.hpp index 955142250..7c65122cc 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_client.hpp @@ -87,14 +87,14 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * written, and there must not be a request entity body included with the * request. * @param options Optional parameters to append data to the resource the path points to. - * @return Azure::Core::Response containing the + * @return Azure::Core::Response containing the * information returned when appending some data to the path. * @remark This request is sent to dfs endpoint. */ - Azure::Core::Response AppendData( + Azure::Core::Response Append( Azure::Core::Http::BodyStream* content, int64_t offset, - const AppendDataLakeFileDataOptions& options = AppendDataLakeFileDataOptions()) const; + const AppendDataLakeFileOptions& options = AppendDataLakeFileOptions()) const; /** * @brief Flushes previous uploaded data to a file. @@ -107,13 +107,13 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * written, and there must not be a request entity body included with the * request. * @param options Optional parameters to flush data to the resource the path points to. - * @return Azure::Core::Response containing the information + * @return Azure::Core::Response containing the information * returned when flushing the data appended to the path. * @remark This request is sent to dfs endpoint. */ - Azure::Core::Response FlushData( + Azure::Core::Response Flush( int64_t endingOffset, - const FlushDataLakeFileDataOptions& options = FlushDataLakeFileDataOptions()) const; + const FlushDataLakeFileOptions& options = FlushDataLakeFileOptions()) const; /** * @brief Create a file. By default, the destination is overwritten and diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp index 48605a941..5d2ff4692 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp @@ -209,9 +209,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { }; /** - * @brief Optional parameters for PathClient::AppendData + * @brief Optional parameters for PathClient::Append */ - struct AppendDataLakeFileDataOptions + struct AppendDataLakeFileOptions { /** * @brief Context for cancelling long running operations. @@ -230,9 +230,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { }; /** - * @brief Optional parameters for PathClient::FlushData + * @brief Optional parameters for PathClient::Flush */ - struct FlushDataLakeFileDataOptions + struct FlushDataLakeFileOptions { /** * @brief Context for cancelling long running operations. diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_responses.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_responses.hpp index 92020288d..5d8c3f2c1 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_responses.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_responses.hpp @@ -154,8 +154,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam // FileClient models: using UploadDataLakeFileFromResult = Blobs::Models::UploadBlockBlobResult; - using AppendDataLakeFileDataResult = PathAppendDataResult; - using FlushDataLakeFileDataResult = PathFlushDataResult; + using AppendDataLakeFileResult = PathAppendDataResult; + using FlushDataLakeFileResult = PathFlushDataResult; using ScheduleDataLakeFileDeletionResult = Blobs::Models::SetBlobExpiryResult; struct ReadDataLakeFileResult diff --git a/sdk/storage/azure-storage-files-datalake/sample/datalake_getting_started.cpp b/sdk/storage/azure-storage-files-datalake/sample/datalake_getting_started.cpp index 03a12e8a9..74dcc4599 100644 --- a/sdk/storage/azure-storage-files-datalake/sample/datalake_getting_started.cpp +++ b/sdk/storage/azure-storage-files-datalake/sample/datalake_getting_started.cpp @@ -66,16 +66,16 @@ void DataLakeGettingStarted() // One way of passing in the buffer, note that the buffer is not copied. auto bufferStream = Azure::Core::Http::MemoryBodyStream(buffer); - fileClient.AppendData(&bufferStream, 0 /* Offset of the position to be appended.*/); + fileClient.Append(&bufferStream, 0 /* Offset of the position to be appended.*/); // Another way of passing in the buffer, note that buffer is also not copied. bufferStream = Azure::Core::Http::MemoryBodyStream( reinterpret_cast(str2.data()), str2.size()); - fileClient.AppendData(&bufferStream, str1.size()); + fileClient.Append(&bufferStream, str1.size()); // Flush - fileClient.FlushData(str1.size() + str2.size()); + fileClient.Flush(str1.size() + str2.size()); // Read auto result = fileClient.Read(); diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp index ea185adcb..d5963f882 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp @@ -197,10 +197,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { m_pipeline = std::make_shared(policies); } - Azure::Core::Response DataLakeFileClient::AppendData( + Azure::Core::Response DataLakeFileClient::Append( Azure::Core::Http::BodyStream* content, int64_t offset, - const AppendDataLakeFileDataOptions& options) const + const AppendDataLakeFileOptions& options) const { Details::DataLakeRestClient::Path::AppendDataOptions protocolLayerOptions; protocolLayerOptions.Position = offset; @@ -221,9 +221,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { m_dfsUrl, *content, *m_pipeline, options.Context, protocolLayerOptions); } - Azure::Core::Response DataLakeFileClient::FlushData( + Azure::Core::Response DataLakeFileClient::Flush( int64_t endingOffset, - const FlushDataLakeFileDataOptions& options) const + const FlushDataLakeFileOptions& options) const { Details::DataLakeRestClient::Path::FlushDataOptions protocolLayerOptions; protocolLayerOptions.Position = endingOffset; diff --git a/sdk/storage/azure-storage-files-datalake/test/datalake_file_client_test.cpp b/sdk/storage/azure-storage-files-datalake/test/datalake_file_client_test.cpp index cc539bae5..b3d5fb45b 100644 --- a/sdk/storage/azure-storage-files-datalake/test/datalake_file_client_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/datalake_file_client_test.cpp @@ -331,7 +331,7 @@ namespace Azure { namespace Storage { namespace Test { auto properties1 = m_fileClient->GetProperties(); // Append - m_fileClient->AppendData(bufferStream.get(), 0); + m_fileClient->Append(bufferStream.get(), 0); auto properties2 = m_fileClient->GetProperties(); // Append does not change etag because not committed yet. EXPECT_EQ(properties1->ETag, properties2->ETag); @@ -339,7 +339,7 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_EQ(properties1->LastModified, properties2->LastModified); // Flush - m_fileClient->FlushData(bufferSize); + m_fileClient->Flush(bufferSize); auto properties3 = m_fileClient->GetProperties(); EXPECT_NE(properties2->ETag, properties3->ETag); @@ -362,7 +362,7 @@ namespace Azure { namespace Storage { namespace Test { auto properties1 = newFileClient->GetProperties(); // Append - newFileClient->AppendData(bufferStream.get(), 0); + newFileClient->Append(bufferStream.get(), 0); auto properties2 = newFileClient->GetProperties(); // Append does not change etag because not committed yet. EXPECT_EQ(properties1->ETag, properties2->ETag); @@ -370,7 +370,7 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_EQ(properties1->LastModified, properties2->LastModified); // Flush - newFileClient->FlushData(bufferSize); + newFileClient->Flush(bufferSize); auto properties3 = newFileClient->GetProperties(); EXPECT_NE(properties2->ETag, properties3->ETag);