From 21ed9e3376f44d91b914c28518812f7053a25f54 Mon Sep 17 00:00:00 2001 From: Kan Tang Date: Wed, 13 Jan 2021 16:51:53 +0800 Subject: [PATCH] Refined list related API names. (#1350) # Pull Request Checklist Please leverage this checklist as a reminder to address commonly occurring feedback when submitting a pull request to make sure your PR can be reviewed quickly: See the detailed list in the [contributing guide](https://github.com/Azure/azure-sdk-for-cpp/blob/master/CONTRIBUTING.md#pull-requests). - [x] [C++ Guidelines](https://azure.github.io/azure-sdk/cpp_introduction.html) - [x] Doxygen docs - [x] Unit tests - [x] No unwanted commits/changes - [x] Descriptive title/description - [x] PR is single purpose - [x] Related issue listed - [x] Comments in source - [x] No typos - [x] Update changelog - [x] Not work-in-progress - [x] External references or docs updated - [x] Self review of PR done - [x] Any breaking changes? --- sdk/storage/azure-storage-files-datalake/CHANGELOG.md | 1 + .../files/datalake/datalake_file_system_client.hpp | 8 ++++---- .../inc/azure/storage/files/datalake/datalake_options.hpp | 6 +++--- .../azure/storage/files/datalake/datalake_responses.hpp | 2 +- .../storage/files/datalake/datalake_service_client.hpp | 4 ++-- .../src/datalake_file_system_client.cpp | 5 ++--- .../test/datalake_file_system_client_test.cpp | 8 ++++---- .../test/datalake_sas_test.cpp | 6 +++--- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md index 20fa24d1c..3bda0c8d3 100644 --- a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md @@ -19,6 +19,7 @@ - `ReadFileResult` now have `ContentRange` as string. - `ReadFileOptions` now have `Azure::Core::Http::Range Range` instead of `Content-Length` and `Offset`. - Replace scoped enums that don't support bitwise operations with extensible enum. +- `ListPaths` is renamed to `ListPathsSinglePage` and its related return type and options are also renamed accordingly. ## 12.0.0-beta.5 (2020-11-13) diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_system_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_system_client.hpp index 32912e55e..91f12a5f8 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_system_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_system_client.hpp @@ -177,13 +177,13 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * filesystem are listed. If "directory" is specified, the list will only * include paths that share the same root. * @param options Optional parameters to list the paths in file system. - * @return Azure::Core::Response containing the results when - * listing the paths under a file system. + * @return Azure::Core::Response containing the + * results when listing the paths under a file system. * @remark This request is sent to dfs endpoint. */ - Azure::Core::Response ListPaths( + Azure::Core::Response ListPathsSinglePage( bool recursive, - const ListDataLakePathsOptions& options = ListDataLakePathsOptions()) const; + const ListPathsSinglePageOptions& options = ListPathsSinglePageOptions()) const; private: Azure::Core::Http::Url m_dfsUri; 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 3c4f26722..6e7682637 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 @@ -76,7 +76,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { }; /** - * @brief Optional parameters for ServiceClient::ListFilesSystems + * @brief Optional parameters for ServiceClient::ListFileSystemsSinglePageOptions */ struct ListFileSystemsSinglePageOptions { @@ -175,9 +175,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { }; /** - * @brief Optional parameters for FileSystemClient::ListPaths + * @brief Optional parameters for FileSystemClient::ListPathsSinglePage */ - struct ListDataLakePathsOptions + struct ListPathsSinglePageOptions { /** * @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 613034531..63f836e6e 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 @@ -21,7 +21,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam // FileSystemClient models: - using ListDataLakePathsResult = FileSystemListPathsResult; + using ListPathsSinglePageResult = FileSystemListPathsResult; struct GetDataLakeFileSystemPropertiesResult { diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp index b12699886..a92297bb4 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp @@ -89,8 +89,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { /** * @brief List the file systems from the service. * @param options Optional parameters to list the file systems. - * @return Azure::Core::Response containing the listed - * result of file systems and continuation token for unfinished list result. + * @return Azure::Core::Response containing the + * listed result of file systems and continuation token for unfinished list result. * @remark This request is sent to blob endpoint. */ Azure::Core::Response ListFileSystemsSinglePage( diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp index 9ac0e2b20..2cd485269 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp @@ -289,9 +289,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { std::move(ret), result.ExtractRawResponse()); } - Azure::Core::Response DataLakeFileSystemClient::ListPaths( - bool recursive, - const ListDataLakePathsOptions& options) const + Azure::Core::Response DataLakeFileSystemClient:: + ListPathsSinglePage(bool recursive, const ListPathsSinglePageOptions& options) const { Details::DataLakeRestClient::FileSystem::ListDataLakePathsOptions protocolLayerOptions; protocolLayerOptions.Resource = Models::FileSystemResourceType::Filesystem; diff --git a/sdk/storage/azure-storage-files-datalake/test/datalake_file_system_client_test.cpp b/sdk/storage/azure-storage-files-datalake/test/datalake_file_system_client_test.cpp index 5871e6c04..d241f26c8 100644 --- a/sdk/storage/azure-storage-files-datalake/test/datalake_file_system_client_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/datalake_file_system_client_test.cpp @@ -56,14 +56,14 @@ namespace Azure { namespace Storage { namespace Test { { std::vector result; std::string continuation; - Files::DataLake::ListDataLakePathsOptions options; + Files::DataLake::ListPathsSinglePageOptions options; if (!directory.empty()) { options.Directory = directory; } do { - auto response = m_fileSystemClient->ListPaths(recursive, options); + auto response = m_fileSystemClient->ListPathsSinglePage(recursive, options); result.insert(result.end(), response->Paths.begin(), response->Paths.end()); if (response->ContinuationToken.HasValue()) { @@ -281,9 +281,9 @@ namespace Azure { namespace Storage { namespace Test { } { // List max result - Files::DataLake::ListDataLakePathsOptions options; + Files::DataLake::ListPathsSinglePageOptions options; options.PageSizeHint = 2; - auto response = m_fileSystemClient->ListPaths(true, options); + auto response = m_fileSystemClient->ListPathsSinglePage(true, options); EXPECT_LE(2U, response->Paths.size()); } } diff --git a/sdk/storage/azure-storage-files-datalake/test/datalake_sas_test.cpp b/sdk/storage/azure-storage-files-datalake/test/datalake_sas_test.cpp index 088c3b9c1..2d1f22e75 100644 --- a/sdk/storage/azure-storage-files-datalake/test/datalake_sas_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/datalake_sas_test.cpp @@ -90,14 +90,14 @@ namespace Azure { namespace Storage { namespace Test { auto verify_filesystem_list = [&](const std::string& sas) { auto filesystemClient = Files::DataLake::DataLakeFileSystemClient(filesystemUri + sas); - EXPECT_NO_THROW(filesystemClient.ListPaths(true)); + EXPECT_NO_THROW(filesystemClient.ListPathsSinglePage(true)); }; auto verify_directory_list = [&](const std::string& sas) { auto filesystemClient = Files::DataLake::DataLakeFileSystemClient(filesystemUri + sas); - Files::DataLake::ListDataLakePathsOptions options; + Files::DataLake::ListPathsSinglePageOptions options; options.Directory = directory1Name; - EXPECT_NO_THROW(filesystemClient.ListPaths(true, options)); + EXPECT_NO_THROW(filesystemClient.ListPathsSinglePage(true, options)); }; auto verify_file_create = [&](const std::string& sas) {