cspell for storage (#2800)

* cspell for storage

* aaa
This commit is contained in:
JinmingHu 2021-08-27 11:55:07 +08:00 committed by GitHub
parent cfda7f00fa
commit 8cae42999e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 53 additions and 39 deletions

37
.vscode/cspell.json vendored
View File

@ -17,8 +17,7 @@
"*nlohmann-json*",
"sdk/identity/**/*",
"sdk/core/**/*",
"sdk/keyvault/**/*",
"sdk/storage/**/*"
"sdk/keyvault/**/*"
],
// * Unless configured otherwise, these words are not case sensitive
// * Alphabetize the list when making changes so the list is easier for future
@ -109,24 +108,6 @@
"iname"
]
},
{
"filename": "**/sdk/storage/azure-storage-common/src/crypt.cpp",
"words": [
"wdata"
]
},
{
"filename": "**/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp",
"words": [
"dacl"
]
},
{
"filename": "**/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp",
"words": [
"xmsblobsequencenumber"
]
},
{
"filename": "**/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_client_models.hpp",
"words": [
@ -135,9 +116,21 @@
]
},
{
"filename": "**/sdk/storage/azure-storage-common/test/test_base.hpp",
"filename": "**/sdk/storage/azure-storage-common/CHANGELOG.md",
"words": [
"FQJQ"
"johnwheffner",
"Heffner",
"lordgamez",
"Gabor",
"Gyimesi"
]
},
{
"filename": "**/sdk/storage/test-resources.json",
"words": [
"bfqt",
"rwdlacup",
"pfile"
]
}
],

View File

@ -137,7 +137,7 @@ If you wish to rotate the key within your `BlobServiceClient` (and any derived c
**The legacy SDK used a stateful model.** There were container and blob objects that held state regarding service resources and required the user to manually call their update methods. But blob contents were not a part of this state and had to be uploaded/downloaded whenever they were to be interacted with. This became increasingly confusing over time, and increasingly susceptible to thread safety issues.
The modern SDK has taken a client-based approach. There are no objects designed to be representations of storage resources, but instead clients that act as your mechanism to interact with your storage resources in the cloud. **Clients hold no state of your resources.** (Lease client is an exception.) This is most noticable when looking at [blob metadata](#managing-blob-metadata).
The modern SDK has taken a client-based approach. There are no objects designed to be representations of storage resources, but instead clients that act as your mechanism to interact with your storage resources in the cloud. **Clients hold no state of your resources.** (Lease client is an exception.) This is most noticeable when looking at [blob metadata](#managing-blob-metadata).
The hierarchical structure of Azure Blob Storage can be understood by the following diagram:
![Blob Storage Hierarchy](https://docs.microsoft.com/azure/storage/blobs/media/storage-blobs-introduction/blob1.png)
@ -148,7 +148,7 @@ In the interest of simplifying the API surface, v12 uses three top level clients
Note the absence of a v12 equivalent for v7.5's `cloud_blob_directory`. Directories were an SDK-only concept that did not exist in Azure Blob Storage, and which were not brought forwards into the modern Storage SDK. As shown by the diagram in [Client Structure](#client-structure), containers only contain a flat list of blobs, but those blobs can be named and listed in ways that imply a folder-like structure. See our [Listing Blobs in a Container](#listing-blobs-in-a-container) migration samples later in this guide for more information.
For those whose workloads revolve around manipulating directories and heavily relied on the leagacy SDKs abstraction of this structure, consider the [pros and cons of enabling hierarchical namespace](https://docs.microsoft.com/azure/storage/blobs/data-lake-storage-namespace) on your storage account, which would allow switching to the [Data Lake Gen 2 SDK](https://github.com/Azure/azure-sdk-for-cpp/tree/main/sdk/storage/azure-storage-files-datalake), whose migration is not covered in this document.
For those whose workloads revolve around manipulating directories and heavily relied on the legacy SDKs abstraction of this structure, consider the [pros and cons of enabling hierarchical namespace](https://docs.microsoft.com/azure/storage/blobs/data-lake-storage-namespace) on your storage account, which would allow switching to the [Data Lake Gen 2 SDK](https://github.com/Azure/azure-sdk-for-cpp/tree/main/sdk/storage/azure-storage-files-datalake), whose migration is not covered in this document.
#### Class Conversion Reference
@ -350,7 +350,7 @@ blob_client.download_to_file(local_file_path);
// modify blob content
// reupload modified blob content while preserving metadata
// re-upload modified blob content while preserving metadata
blob_client.upload_from_file(local_file_path);
```
@ -364,7 +364,7 @@ metadata["foo"] = "bar";
blobClient.SetMetadata(metadata);
```
Additionally with blob content edits, if your blobs have metadata you need to get the metadata and reupload with that metadata, telling the service what metadata goes with this new blob state.
Additionally with blob content edits, if your blobs have metadata you need to get the metadata and re-upload with that metadata, telling the service what metadata goes with this new blob state.
```C++
// download blob content and metadata
@ -373,7 +373,7 @@ auto metadata = response.Value.Metadata;
// modify blob content
// reupload modified blob content while preserving metadata
// re-upload modified blob content while preserving metadata
// not adding metadata is a metadata clear
UploadBlockBlobFromOptions uploadOptions;
uploadOptions.Metadata = metadata;

View File

@ -23,6 +23,8 @@
#include "azure/storage/blobs/dll_import_export.hpp"
/* cSpell:disable */
namespace Azure { namespace Storage { namespace Blobs {
namespace Models {

View File

@ -6,6 +6,8 @@
#include <azure/core/http/http.hpp>
#include <azure/storage/common/crypt.hpp>
/* cSpell:ignore rscc, rscd, rsce, rscl, rsct, skoid, sktid */
namespace Azure { namespace Storage { namespace Sas {
namespace {

View File

@ -390,6 +390,7 @@ namespace Azure { namespace Storage { namespace Test {
identifier.Id = RandomString(64);
identifier.StartsOn = std::chrono::system_clock::now() - std::chrono::minutes(2);
identifier.ExpiresOn = std::chrono::system_clock::now() + std::chrono::minutes(2);
/* cspell:disable-next-line */
identifier.Permissions = "racwdxlt";
options.SignedIdentifiers.emplace_back(identifier);

View File

@ -20,7 +20,7 @@ namespace Azure { namespace Storage {
public:
/**
* @brief Concatenates another #Crc64 instance after this instance. This operation has the same
* effect as if the data in the other instance was appened to this instance.
* effect as if the data in the other instance was append to this instance.
*
* @param other Another #Crc64Hash instance to be concatenated after this instance.
*/

View File

@ -866,7 +866,7 @@ namespace Azure { namespace Storage {
size_t uStop = length - (length % 32);
if (uStop >= 2 * 32)
{
const uint64_t* wdata = reinterpret_cast<const uint64_t*>(data);
const uint64_t* wData = reinterpret_cast<const uint64_t*>(data);
uint64_t uCrc0 = 0;
uint64_t uCrc1 = 0;
@ -876,12 +876,12 @@ namespace Azure { namespace Storage {
length -= uStop;
uCrc0 = uCrc;
for (; pData < pLast; pData += 32, wdata += 4)
for (; pData < pLast; pData += 32, wData += 4)
{
uint64_t b0 = wdata[0] ^ uCrc0;
uint64_t b1 = wdata[1] ^ uCrc1;
uint64_t b2 = wdata[2] ^ uCrc2;
uint64_t b3 = wdata[3] ^ uCrc3;
uint64_t b0 = wData[0] ^ uCrc0;
uint64_t b1 = wData[1] ^ uCrc1;
uint64_t b2 = wData[2] ^ uCrc2;
uint64_t b3 = wData[3] ^ uCrc3;
uCrc0 = Crc64MU32[7 * 256 + (b0 & 0xff)];
b0 >>= 8;
@ -953,7 +953,7 @@ namespace Azure { namespace Storage {
}
uCrc = 0;
uCrc ^= wdata[0] ^ uCrc0;
uCrc ^= wData[0] ^ uCrc0;
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
@ -963,7 +963,7 @@ namespace Azure { namespace Storage {
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc ^= wdata[1] ^ uCrc1;
uCrc ^= wData[1] ^ uCrc1;
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
@ -973,7 +973,7 @@ namespace Azure { namespace Storage {
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc ^= wdata[2] ^ uCrc2;
uCrc ^= wData[2] ^ uCrc2;
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
@ -983,7 +983,7 @@ namespace Azure { namespace Storage {
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc ^= wdata[3] ^ uCrc3;
uCrc ^= wData[3] ^ uCrc3;
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];
uCrc = (uCrc >> 8) ^ Crc64MU1[uCrc & 0xff];

View File

@ -53,7 +53,9 @@ namespace Azure { namespace Storage {
const static Azure::ETag DummyETag("0x8D83B58BDF51D75");
const static Azure::ETag DummyETag2("0x8D812645BFB0CDE");
/* cspell:disable-next-line */
constexpr static const char* DummyMd5 = "tQbD1aMPeB+LiPffUwFQJQ==";
/* cspell:disable-next-line */
constexpr static const char* DummyCrc64 = "+DNR5PON4EM=";
uint64_t RandomInt(

View File

@ -6,6 +6,8 @@
#include <azure/core/http/http.hpp>
#include <azure/storage/common/crypt.hpp>
/* cSpell:ignore rscc, rscd, rsce, rscl, rsct, skoid, sktid, saoid, suoid, scid */
namespace Azure { namespace Storage { namespace Sas {
namespace {
std::string DataLakeSasResourceToString(DataLakeSasResource resource)

View File

@ -302,7 +302,9 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_NO_THROW(client1.Create(options1));
EXPECT_NO_THROW(client2.Create(options2));
auto result = client1.GetProperties().Value.Metadata;
/* cspell:disable-next-line */
metadata1["hdi_isfolder"] = "true";
/* cspell:disable-next-line */
metadata2["hdi_isfolder"] = "true";
EXPECT_EQ(metadata1, result);
result = client2.GetProperties().Value.Metadata;

View File

@ -370,6 +370,7 @@ namespace Azure { namespace Storage { namespace Test {
identifier.Id = RandomString(64);
identifier.StartsOn = std::chrono::system_clock::now() - std::chrono::minutes(2);
identifier.ExpiresOn = std::chrono::system_clock::now() + std::chrono::minutes(2);
/* cspell:disable-next-line */
identifier.Permissions = "racwdxlt";
options.SignedIdentifiers.emplace_back(identifier);

View File

@ -27,6 +27,8 @@
#include <azure/storage/common/storage_common.hpp>
#include <azure/storage/common/storage_exception.hpp>
/* cSpell:disable */
namespace Azure { namespace Storage { namespace Files { namespace Shares {
namespace Models {

View File

@ -13,6 +13,8 @@
#include "azure/storage/files/shares/protocol/share_rest_client.hpp"
/* cSpell:ignore dacl */
namespace Azure { namespace Storage { namespace Files { namespace Shares {
/**

View File

@ -399,7 +399,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
*/
int32_t NumberOfHandlesClosed = 0;
/**
* Number of file handles that fialed to close.
* Number of file handles that failed to close.
*/
int32_t NumberOfHandlesFailedToClose = 0;

View File

@ -6,6 +6,8 @@
#include <azure/core/http/http.hpp>
#include <azure/storage/common/crypt.hpp>
/* cSpell:ignore rscc, rscd, rsce, rscl, rsct */
namespace Azure { namespace Storage { namespace Sas {
namespace {

View File

@ -21,6 +21,8 @@
#include "azure/storage/queues/dll_import_export.hpp"
/* cSpell:disable */
namespace Azure { namespace Storage { namespace Queues {
namespace Models {

View File

@ -139,6 +139,7 @@ namespace Azure { namespace Storage { namespace Test {
identifier.Id = RandomString(64);
identifier.StartsOn = std::chrono::system_clock::now() - std::chrono::minutes(2);
identifier.ExpiresOn = std::chrono::system_clock::now() + std::chrono::minutes(2);
/* cspell:disable-next-line */
identifier.Permissions = "raup";
signedIdentifiers.emplace_back(identifier);