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?
This commit is contained in:
parent
abf4a6bb29
commit
21ed9e3376
@ -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)
|
||||
|
||||
|
||||
@ -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<Models::ListDataLakePathsResult> containing the results when
|
||||
* listing the paths under a file system.
|
||||
* @return Azure::Core::Response<Models::ListPathsSinglePageResult> containing the
|
||||
* results when listing the paths under a file system.
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<Models::ListDataLakePathsResult> ListPaths(
|
||||
Azure::Core::Response<Models::ListPathsSinglePageResult> ListPathsSinglePage(
|
||||
bool recursive,
|
||||
const ListDataLakePathsOptions& options = ListDataLakePathsOptions()) const;
|
||||
const ListPathsSinglePageOptions& options = ListPathsSinglePageOptions()) const;
|
||||
|
||||
private:
|
||||
Azure::Core::Http::Url m_dfsUri;
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -21,7 +21,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
|
||||
|
||||
// FileSystemClient models:
|
||||
|
||||
using ListDataLakePathsResult = FileSystemListPathsResult;
|
||||
using ListPathsSinglePageResult = FileSystemListPathsResult;
|
||||
|
||||
struct GetDataLakeFileSystemPropertiesResult
|
||||
{
|
||||
|
||||
@ -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<Models::ListFileSystemsSinglePageResult> containing the listed
|
||||
* result of file systems and continuation token for unfinished list result.
|
||||
* @return Azure::Core::Response<Models::ListFileSystemsSinglePageResult> 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<Models::ListFileSystemsSinglePageResult> ListFileSystemsSinglePage(
|
||||
|
||||
@ -289,9 +289,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::ListDataLakePathsResult> DataLakeFileSystemClient::ListPaths(
|
||||
bool recursive,
|
||||
const ListDataLakePathsOptions& options) const
|
||||
Azure::Core::Response<Models::ListPathsSinglePageResult> DataLakeFileSystemClient::
|
||||
ListPathsSinglePage(bool recursive, const ListPathsSinglePageOptions& options) const
|
||||
{
|
||||
Details::DataLakeRestClient::FileSystem::ListDataLakePathsOptions protocolLayerOptions;
|
||||
protocolLayerOptions.Resource = Models::FileSystemResourceType::Filesystem;
|
||||
|
||||
@ -56,14 +56,14 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
{
|
||||
std::vector<Files::DataLake::Models::Path> 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());
|
||||
}
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user