Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions sdk/storage/azure-storage-blobs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
### Features Added

- Added support for persisted session authentication for eligible blob download requests.
- Added `BlobClient::GetLayout` and related options and response types for retrieving locality
endpoints, byte ranges, and blob properties. Ranges are exposed directly through
`Models::BlobLayoutInfo::Ranges` as a vector of `Models::BlobLayoutRange`.
- Added `DownloadBlobOptions::LayoutEndpoint` for one-shot download routing and
`DownloadBlobToOptions::LayoutAwareRouting` (`Auto`, `Disabled`, `Enabled`; default `Disabled`) for
- Added `DownloadBlobToOptions::LayoutAwareRouting` (`Auto`, `Disabled`, `Enabled`; default `Disabled`) for
managed downloads.
- Added `Models::DownloadHint` and `Models::DownloadBlobDetails::DownloadHint`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
namespace Azure { namespace Storage { namespace Blobs {

namespace _detail {
class DataLocalityLayoutState;
AZ_STORAGE_BLOBS_DLLEXPORT extern const Azure::Core::Context::Key
DataLakeInteroperabilityExtraOptionsKey;
} // namespace _detail
Expand Down Expand Up @@ -425,17 +426,6 @@ namespace Azure { namespace Storage { namespace Blobs {
const GetAccountInfoOptions& options = GetAccountInfoOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;

/**
* @brief Gets the data locality layout for this blob.
*
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return A paged response containing the blob's data locality layout.
*/
BlobLayoutPagedResponse GetLayout(
const GetBlobLayoutOptions& options = GetBlobLayoutOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;

protected:
/** @brief Blob Url */
Azure::Core::Url m_blobUrl;
Expand All @@ -445,6 +435,10 @@ namespace Azure { namespace Storage { namespace Blobs {
_detail::BlobClientConfiguration m_clientConfiguration;

private:
_detail::BlobLayoutPagedResponse GetLayout(
const _detail::GetBlobLayoutOptions& options = _detail::GetBlobLayoutOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;

explicit BlobClient(
Azure::Core::Url blobUrl,
std::shared_ptr<Azure::Core::Http::_internal::HttpPipeline> pipeline,
Expand All @@ -461,5 +455,7 @@ namespace Azure { namespace Storage { namespace Blobs {
friend class BlobLeaseClient;
friend class BlobServiceBatch;
friend class BlobContainerBatch;
friend class _detail::BlobLayoutPagedResponse;
friend class _detail::DataLocalityLayoutState;
};
}}} // namespace Azure::Storage::Blobs
Original file line number Diff line number Diff line change
Expand Up @@ -932,14 +932,6 @@ namespace Azure { namespace Storage { namespace Blobs {
* @brief Optional. Configures whether to do content validation for blob downloads.
*/
Azure::Nullable<TransferValidationOptions> ValidationOptions;

/**
* @brief Optional. The layout endpoint to use for this download.
*
* When set, the request is sent to this endpoint while preserving the client endpoint in the
* Host header.
*/
std::string LayoutEndpoint;
};

/**
Expand Down Expand Up @@ -1957,28 +1949,28 @@ namespace Azure { namespace Storage { namespace Blobs {
{
};

/**
* @brief Optional parameters for #Azure::Storage::Blobs::BlobClient::GetLayout.
*/
struct GetBlobLayoutOptions final
{
namespace _detail {
/**
* @brief The range of bytes for which to retrieve the layout.
* @brief Optional parameters for BlobClient::GetLayout.
*/
Azure::Nullable<Core::Http::HttpRange> Range;
struct GetBlobLayoutOptions final
{
/**
* @brief The range of bytes for which to retrieve the layout.
*/
Azure::Nullable<Core::Http::HttpRange> Range;

/**
* @brief The continuation token for retrieving the next page.
*/
Azure::Nullable<std::string> ContinuationToken;
/**
* @brief The continuation token for retrieving the next page.
*/
Azure::Nullable<std::string> ContinuationToken;

/**
* @brief Access conditions for the operation.
*/
BlobAccessConditions AccessConditions;
};
/**
* @brief Access conditions for the operation.
*/
BlobAccessConditions AccessConditions;
};

namespace _detail {
inline std::string TagsToString(const std::map<std::string, std::string>& tags)
{
return std::accumulate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,39 @@ namespace Azure { namespace Storage {

namespace Models {

/**
* @brief Describes a range in a blob's data locality layout.
*/
struct BlobLayoutRange final
{
namespace _detail {
/**
* @brief The range of bytes served by the endpoint.
* @brief Describes a range in a blob's data locality layout.
*/
Azure::Core::Http::HttpRange Range;
struct BlobLayoutRange final
{
/**
* @brief The range of bytes served by the endpoint.
*/
Azure::Core::Http::HttpRange Range;

/**
* @brief The host and port of the endpoint serving this range.
*/
std::string Endpoint;
};

/**
* @brief The host and port of the endpoint serving this range.
* @brief A page of blob layout information and the blob properties returned with it.
*/
std::string Endpoint;
};
struct BlobLayoutInfo final
{
/**
* @brief The ranges in this page of the blob's data locality layout.
*/
std::vector<BlobLayoutRange> Ranges;

/**
* @brief A page of blob layout information and the blob properties returned with it.
*/
struct BlobLayoutInfo final
{
/**
* @brief The ranges in this page of the blob's data locality layout.
*/
std::vector<BlobLayoutRange> Ranges;

/**
* @brief The blob properties returned with the layout.
*/
BlobProperties Properties;
};
/**
* @brief The blob properties returned with the layout.
*/
BlobProperties Properties;
};
} // namespace _detail

/**
* @brief Response type for #Azure::Storage::Blobs::BlobClient::DownloadTo.
Expand Down Expand Up @@ -514,28 +516,28 @@ namespace Azure { namespace Storage {
friend class Azure::Core::PagedResponse<GetPageRangesDiffPagedResponse>;
};

/**
* @brief Response type for #Azure::Storage::Blobs::BlobClient::GetLayout.
*/
class BlobLayoutPagedResponse final
: public Azure::Core::PagedResponse<BlobLayoutPagedResponse> {
public:
namespace _detail {
/**
* @brief The layout and blob properties in this page.
* @brief Response type for BlobClient::GetLayout.
*/
Models::BlobLayoutInfo Layout;
class BlobLayoutPagedResponse final
: public Azure::Core::PagedResponse<BlobLayoutPagedResponse> {
public:
/**
* @brief The layout and blob properties in this page.
*/
Models::_detail::BlobLayoutInfo Layout;

private:
void OnNextPage(const Azure::Core::Context& context);
private:
void OnNextPage(const Azure::Core::Context& context);

std::shared_ptr<Blobs::BlobClient> m_blobClient;
GetBlobLayoutOptions m_operationOptions;
std::shared_ptr<Blobs::BlobClient> m_blobClient;
GetBlobLayoutOptions m_operationOptions;

friend class Blobs::BlobClient;
friend class Azure::Core::PagedResponse<BlobLayoutPagedResponse>;
};
friend class Blobs::BlobClient;
friend class Azure::Core::PagedResponse<BlobLayoutPagedResponse>;
};

namespace _detail {
void ParseListBlobsResult(Models::_detail::ListBlobsResult& result);
} // namespace _detail

Expand Down
Loading
Loading