Remove Data suffix according to review comments. (#1397)

* Remove Data suffix according to review comments.

* Update readme.
This commit is contained in:
Kan Tang 2021-01-20 19:37:51 +08:00 committed by GitHub
parent e2a49a127b
commit bbbf8bff39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 24 additions and 23 deletions

View File

@ -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`.

View File

@ -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<Models::AppendDataLakeFileDataResult> containing the
* @return Azure::Core::Response<Models::AppendDataLakeFileResult> containing the
* information returned when appending some data to the path.
* @remark This request is sent to dfs endpoint.
*/
Azure::Core::Response<Models::AppendDataLakeFileDataResult> AppendData(
Azure::Core::Response<Models::AppendDataLakeFileResult> 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<Models::FlushDataLakeFileDataResult> containing the information
* @return Azure::Core::Response<Models::FlushDataLakeFileResult> containing the information
* returned when flushing the data appended to the path.
* @remark This request is sent to dfs endpoint.
*/
Azure::Core::Response<Models::FlushDataLakeFileDataResult> FlushData(
Azure::Core::Response<Models::FlushDataLakeFileResult> 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

View File

@ -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.

View File

@ -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

View File

@ -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<const uint8_t*>(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();

View File

@ -197,10 +197,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
m_pipeline = std::make_shared<Azure::Core::Http::HttpPipeline>(policies);
}
Azure::Core::Response<Models::AppendDataLakeFileDataResult> DataLakeFileClient::AppendData(
Azure::Core::Response<Models::AppendDataLakeFileResult> 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<Models::FlushDataLakeFileDataResult> DataLakeFileClient::FlushData(
Azure::Core::Response<Models::FlushDataLakeFileResult> DataLakeFileClient::Flush(
int64_t endingOffset,
const FlushDataLakeFileDataOptions& options) const
const FlushDataLakeFileOptions& options) const
{
Details::DataLakeRestClient::Path::FlushDataOptions protocolLayerOptions;
protocolLayerOptions.Position = endingOffset;

View File

@ -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);