integrate TelemetryPolicy into Blob Service (#328)
* integrate TelemetryPolicy into Blob Service * Also add telemetry support to ADLS Gen 2. Co-authored-by: Tank Tang <kat@microsoft.com>
This commit is contained in:
parent
b0b348e9cb
commit
29f5e30ad3
@ -10,18 +10,80 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
option(BUILD_STORAGE_SAMPLES "Build sample codes" ON)
|
||||
|
||||
set (AZURE_STORAGE_BLOB_HEADER
|
||||
if(MSVC)
|
||||
add_compile_definitions(NOMINMAX)
|
||||
endif()
|
||||
|
||||
set(AZURE_STORAGE_COMMON_HEADER
|
||||
inc/common/access_conditions.hpp
|
||||
inc/common/common_headers_request_policy.hpp
|
||||
inc/common/concurrent_transfer.hpp
|
||||
inc/common/constants.hpp
|
||||
inc/common/crypt.hpp
|
||||
inc/common/file_io.hpp
|
||||
inc/common/shared_key_policy.hpp
|
||||
inc/common/storage_common.hpp
|
||||
inc/common/storage_credential.hpp
|
||||
inc/common/storage_error.hpp
|
||||
inc/common/storage_uri_builder.hpp
|
||||
inc/common/common_headers_request_policy.hpp
|
||||
inc/common/shared_key_policy.hpp
|
||||
inc/common/crypt.hpp
|
||||
inc/common/storage_version.hpp
|
||||
inc/common/xml_wrapper.hpp
|
||||
inc/common/concurrent_transfer.hpp
|
||||
inc/common/file_io.hpp
|
||||
inc/common/access_conditions.hpp
|
||||
)
|
||||
|
||||
set(AZURE_STORAGE_COMMON_SOURCE
|
||||
src/common/common_headers_request_policy.cpp
|
||||
src/common/crypt.cpp
|
||||
src/common/file_io.cpp
|
||||
src/common/shared_key_policy.cpp
|
||||
src/common/storage_credential.cpp
|
||||
src/common/storage_error.cpp
|
||||
src/common/storage_uri_builder.cpp
|
||||
src/common/xml_wrapper.cpp
|
||||
)
|
||||
|
||||
add_library(azure-storage-common ${AZURE_STORAGE_COMMON_HEADER} ${AZURE_STORAGE_COMMON_SOURCE})
|
||||
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(LibXml2 REQUIRED)
|
||||
|
||||
target_include_directories(azure-storage-common PUBLIC ${LIBXML2_INCLUDE_DIR} $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/external> $<INSTALL_INTERFACE:include/azure_storage>)
|
||||
target_link_libraries(azure-storage-common Threads::Threads azure-core ${LIBXML2_LIBRARIES})
|
||||
|
||||
if(MSVC)
|
||||
target_link_libraries(azure-storage-common bcrypt)
|
||||
# C28020 and C28204 are introduced by nlohmann/json
|
||||
target_compile_options(azure-storage-common PUBLIC /wd28204 /wd28020)
|
||||
else()
|
||||
find_package(OpenSSL REQUIRED)
|
||||
target_link_libraries(azure-storage-common OpenSSL::SSL OpenSSL::Crypto)
|
||||
endif()
|
||||
|
||||
file(READ "inc/common/storage_version.hpp" VERSION_FILE_CONTENT)
|
||||
|
||||
string(REGEX MATCH "CommonComponentVersion = \"([^\"]*)" _ ${VERSION_FILE_CONTENT})
|
||||
if ("${CMAKE_MATCH_1}" STREQUAL "")
|
||||
message(FATAL_ERROR "Failed to get Common component version")
|
||||
endif()
|
||||
set(COMMON_COMPONENT_VERSION ${CMAKE_MATCH_1})
|
||||
message("Common component version ${COMMON_COMPONENT_VERSION}")
|
||||
|
||||
string(REGEX MATCH "BlobServiceVersion = \"([^\"]*)" _ ${VERSION_FILE_CONTENT})
|
||||
if ("${CMAKE_MATCH_1}" STREQUAL "")
|
||||
message(FATAL_ERROR "Failed to get Blob service version")
|
||||
endif()
|
||||
set(BLOB_SERVICE_VERSION ${CMAKE_MATCH_1})
|
||||
message("Blob service version ${BLOB_SERVICE_VERSION}")
|
||||
|
||||
string(REGEX MATCH "DataLakeServiceVersion = \"([^\"]*)" _ ${VERSION_FILE_CONTENT})
|
||||
if ("${CMAKE_MATCH_1}" STREQUAL "")
|
||||
message(FATAL_ERROR "Failed to get DataLake service version")
|
||||
endif()
|
||||
set(DATALAKE_SERVICE_VERSION ${CMAKE_MATCH_1})
|
||||
message("DataLake service version ${DATALAKE_SERVICE_VERSION}")
|
||||
|
||||
set (AZURE_STORAGE_BLOB_HEADER
|
||||
inc/blobs/blob.hpp
|
||||
inc/blobs/blob_service_client.hpp
|
||||
inc/blobs/blob_container_client.hpp
|
||||
@ -30,21 +92,23 @@ set (AZURE_STORAGE_BLOB_HEADER
|
||||
inc/blobs/page_blob_client.hpp
|
||||
inc/blobs/append_blob_client.hpp
|
||||
inc/blobs/blob_options.hpp
|
||||
inc/blobs/internal/protocol/blob_rest_client.hpp
|
||||
inc/blobs/protocol/blob_rest_client.hpp
|
||||
)
|
||||
|
||||
set (AZURE_STORAGE_BLOB_SOURCE
|
||||
src/blobs/blob_service_client.cpp
|
||||
src/blobs/blob_container_client.cpp
|
||||
src/blobs/blob_client.cpp
|
||||
src/blobs/block_blob_client.cpp
|
||||
src/blobs/page_blob_client.cpp
|
||||
src/blobs/append_blob_client.cpp
|
||||
)
|
||||
|
||||
add_library(azure-storage-blob ${AZURE_STORAGE_BLOB_HEADER} ${AZURE_STORAGE_BLOB_SOURCE})
|
||||
target_link_libraries(azure-storage-blob azure-storage-common)
|
||||
|
||||
set (AZURE_STORAGE_DATALAKE_HEADER
|
||||
inc/common/storage_common.hpp
|
||||
inc/common/xml_wrapper.hpp
|
||||
inc/common/storage_error.hpp
|
||||
inc/common/storage_credential.hpp
|
||||
inc/common/storage_uri_builder.hpp
|
||||
inc/common/common_headers_request_policy.hpp
|
||||
inc/common/shared_key_policy.hpp
|
||||
inc/common/crypt.hpp
|
||||
inc/common/constants.hpp
|
||||
inc/datalake/datalake.hpp
|
||||
inc/blobs/internal/protocol/blob_rest_client.hpp
|
||||
inc/datalake/protocol/datalake_rest_client.hpp
|
||||
inc/datalake/datalake_responses.hpp
|
||||
inc/datalake/datalake_options.hpp
|
||||
@ -56,25 +120,7 @@ set (AZURE_STORAGE_DATALAKE_HEADER
|
||||
inc/datalake/directory_client.hpp
|
||||
)
|
||||
|
||||
set (AZURE_STORAGE_BLOB_SOURCE
|
||||
src/common/storage_credential.cpp
|
||||
src/common/storage_uri_builder.cpp
|
||||
src/common/common_headers_request_policy.cpp
|
||||
src/common/shared_key_policy.cpp
|
||||
src/common/storage_error.cpp
|
||||
src/common/crypt.cpp
|
||||
src/common/xml_wrapper.cpp
|
||||
src/common/file_io.cpp
|
||||
src/blobs/blob_service_client.cpp
|
||||
src/blobs/blob_container_client.cpp
|
||||
src/blobs/blob_client.cpp
|
||||
src/blobs/block_blob_client.cpp
|
||||
src/blobs/page_blob_client.cpp
|
||||
src/blobs/append_blob_client.cpp
|
||||
)
|
||||
|
||||
set (AZURE_STORAGE_DATALAKE_SOURCE
|
||||
src/common/storage_credential.cpp
|
||||
src/datalake/service_client.cpp
|
||||
src/datalake/file_system_client.cpp
|
||||
src/datalake/path_client.cpp
|
||||
@ -84,48 +130,12 @@ set (AZURE_STORAGE_DATALAKE_SOURCE
|
||||
src/datalake/datalake_responses.cpp
|
||||
)
|
||||
|
||||
set(AZURE_STORAGE_HEADER
|
||||
${AZURE_STORAGE_BLOB_HEADER}
|
||||
${AZURE_STORAGE_DATALAKE_HEADER}
|
||||
)
|
||||
add_library(azure-storage-file-datalake ${AZURE_STORAGE_DATALAKE_HEADER} ${AZURE_STORAGE_DATALAKE_SOURCE})
|
||||
target_link_libraries(azure-storage-file-datalake azure-storage-blob)
|
||||
|
||||
set(AZURE_STORAGE_SOURCE
|
||||
${AZURE_STORAGE_BLOB_SOURCE}
|
||||
${AZURE_STORAGE_DATALAKE_SOURCE}
|
||||
)
|
||||
|
||||
add_library(azure-storage ${AZURE_STORAGE_HEADER} ${AZURE_STORAGE_SOURCE})
|
||||
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
find_package(LibXml2 REQUIRED)
|
||||
|
||||
target_include_directories(azure-storage PUBLIC ${LIBXML2_INCLUDE_DIR} $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/external> $<INSTALL_INTERFACE:include/azure_storage>)
|
||||
|
||||
target_link_libraries(azure-storage Threads::Threads azure-core ${LIBXML2_LIBRARIES})
|
||||
|
||||
if(MSVC)
|
||||
target_link_libraries(azure-storage bcrypt)
|
||||
target_compile_definitions(azure-storage PRIVATE NOMINMAX)
|
||||
# C28020 and C28204 are introduced by nlohmann/json
|
||||
target_compile_options(azure-storage PUBLIC /wd28204 /wd28020)
|
||||
else()
|
||||
find_package(OpenSSL REQUIRED)
|
||||
target_link_libraries(azure-storage OpenSSL::SSL OpenSSL::Crypto)
|
||||
endif()
|
||||
|
||||
# Set version numbers centralized
|
||||
set(AZURE_STORAGE_VERSION_MAJOR 0)
|
||||
set(AZURE_STORAGE_VERSION_MINOR 1)
|
||||
set(AZURE_STORAGE_VERSION_REVISION 0)
|
||||
|
||||
#install(DIRECTORY include/ DESTINATION include)
|
||||
#install(TARGETS azure-storage
|
||||
# ARCHIVE DESTINATION lib
|
||||
# LIBRARY DESTINATION lib
|
||||
# RUNTIME DESTINATION bin)
|
||||
add_library(azure::storage::common ALIAS azure-storage-common)
|
||||
add_library(azure::storage::blob ALIAS azure-storage-blob)
|
||||
add_library(azure::storage::file::datalake ALIAS azure-storage-file-datalake)
|
||||
|
||||
if(BUILD_STORAGE_SAMPLES)
|
||||
add_subdirectory(sample)
|
||||
@ -135,7 +145,5 @@ if(BUILD_TESTING)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
||||
# make sure that users can consume the project as a library.
|
||||
add_library (azure::storage ALIAS azure-storage)
|
||||
|
||||
generate_documentation(azure-storage 1.0.0-preview.1)
|
||||
# TODO: eng/sys teams is going to fix this
|
||||
generate_documentation(azure-storage 1.0.0-preview.1)
|
||||
|
||||
@ -7,8 +7,7 @@
|
||||
#include "blobs/blob_client.hpp"
|
||||
#include "common/storage_credential.hpp"
|
||||
#include "credentials/credentials.hpp"
|
||||
#include "credentials/policy/policies.hpp"
|
||||
#include "internal/protocol/blob_rest_client.hpp"
|
||||
#include "protocol/blob_rest_client.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#include "common/storage_credential.hpp"
|
||||
#include "common/storage_uri_builder.hpp"
|
||||
#include "credentials/credentials.hpp"
|
||||
#include "internal/protocol/blob_rest_client.hpp"
|
||||
#include "protocol/blob_rest_client.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include "common/storage_credential.hpp"
|
||||
#include "common/storage_uri_builder.hpp"
|
||||
#include "credentials/credentials.hpp"
|
||||
#include "internal/protocol/blob_rest_client.hpp"
|
||||
#include "protocol/blob_rest_client.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/access_conditions.hpp"
|
||||
#include "internal/protocol/blob_rest_client.hpp"
|
||||
#include "protocol/blob_rest_client.hpp"
|
||||
|
||||
#include <limits>
|
||||
#include <string>
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include "common/storage_credential.hpp"
|
||||
#include "common/storage_uri_builder.hpp"
|
||||
#include "credentials/credentials.hpp"
|
||||
#include "internal/protocol/blob_rest_client.hpp"
|
||||
#include "protocol/blob_rest_client.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#include "blobs/blob_client.hpp"
|
||||
#include "common/storage_credential.hpp"
|
||||
#include "credentials/credentials.hpp"
|
||||
#include "internal/protocol/blob_rest_client.hpp"
|
||||
#include "protocol/blob_rest_client.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#include "blobs/blob_client.hpp"
|
||||
#include "common/storage_credential.hpp"
|
||||
#include "credentials/credentials.hpp"
|
||||
#include "internal/protocol/blob_rest_client.hpp"
|
||||
#include "protocol/blob_rest_client.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
@ -5,6 +5,10 @@
|
||||
#pragma once
|
||||
|
||||
namespace Azure { namespace Storage { namespace Details {
|
||||
constexpr static const char* c_BlobServicePackageName = "storageblob";
|
||||
constexpr static const char* c_DatalakeServicePackageName = "storagedatalake";
|
||||
constexpr static const char* c_FileServicePackageName = "storagefile";
|
||||
constexpr static const char* c_QueueServicePackageName = "storagequeue";
|
||||
constexpr static const char* c_HttpQuerySnapshot = "snapshot";
|
||||
constexpr static const char* c_HttpQueryVersionId = "versionid";
|
||||
constexpr static const char* c_StorageScope = "https://storage.azure.com/.default";
|
||||
|
||||
12
sdk/storage/inc/common/storage_version.hpp
Normal file
12
sdk/storage/inc/common/storage_version.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Azure { namespace Storage {
|
||||
|
||||
constexpr static const char* CommonComponentVersion = "1.0.0-private.beta.1";
|
||||
constexpr static const char* BlobServiceVersion = "1.0.0-private.beta.1";
|
||||
constexpr static const char* DataLakeServiceVersion = "1.0.0-private.beta.1";
|
||||
|
||||
}} // namespace Azure::Storage
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "blobs/internal/protocol/blob_rest_client.hpp"
|
||||
#include "blobs/protocol/blob_rest_client.hpp"
|
||||
#include "protocol/datalake_rest_client.hpp"
|
||||
|
||||
namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
|
||||
@ -11,4 +11,4 @@ add_executable (
|
||||
datalake_getting_started.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(azure-storage-sample PRIVATE azure-storage)
|
||||
target_link_libraries(azure-storage-sample azure::storage::blob azure::storage::file::datalake)
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
#include "common/file_io.hpp"
|
||||
#include "common/shared_key_policy.hpp"
|
||||
#include "common/storage_common.hpp"
|
||||
#include "common/storage_version.hpp"
|
||||
#include "credentials/policy/policies.hpp"
|
||||
#include "http/curl/curl.hpp"
|
||||
|
||||
@ -45,6 +46,8 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
: m_blobUrl(blobUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Details::c_BlobServicePackageName, BlobServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -69,6 +72,8 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
: m_blobUrl(blobUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Details::c_BlobServicePackageName, BlobServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -92,6 +97,8 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
: m_blobUrl(blobUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Details::c_BlobServicePackageName, BlobServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
#include "common/constants.hpp"
|
||||
#include "common/shared_key_policy.hpp"
|
||||
#include "common/storage_common.hpp"
|
||||
#include "common/storage_version.hpp"
|
||||
#include "credentials/policy/policies.hpp"
|
||||
#include "http/curl/curl.hpp"
|
||||
|
||||
@ -42,6 +43,8 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
: BlobContainerClient(containerUri, options)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Details::c_BlobServicePackageName, BlobServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -66,6 +69,8 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
: BlobContainerClient(containerUri, options)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Details::c_BlobServicePackageName, BlobServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -91,6 +96,8 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
: m_containerUrl(containerUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Details::c_BlobServicePackageName, BlobServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
#include "common/constants.hpp"
|
||||
#include "common/shared_key_policy.hpp"
|
||||
#include "common/storage_common.hpp"
|
||||
#include "common/storage_version.hpp"
|
||||
#include "credentials/policy/policies.hpp"
|
||||
#include "http/curl/curl.hpp"
|
||||
|
||||
@ -37,6 +38,8 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
: m_serviceUrl(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Details::c_BlobServicePackageName, BlobServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -61,6 +64,8 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
: m_serviceUrl(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Details::c_BlobServicePackageName, BlobServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -86,6 +91,8 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
: m_serviceUrl(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Details::c_BlobServicePackageName, BlobServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include "common/crypt.hpp"
|
||||
#include "common/shared_key_policy.hpp"
|
||||
#include "common/storage_common.hpp"
|
||||
#include "common/storage_version.hpp"
|
||||
#include "credentials/policy/policies.hpp"
|
||||
#include "datalake/datalake_utilities.hpp"
|
||||
#include "http/curl/curl.hpp"
|
||||
@ -46,6 +47,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
: PathClient(directoryUri, credential, options)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -70,6 +73,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
: PathClient(directoryUri, credential, options)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -95,6 +100,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
: PathClient(directoryUri, options)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include "common/crypt.hpp"
|
||||
#include "common/shared_key_policy.hpp"
|
||||
#include "common/storage_common.hpp"
|
||||
#include "common/storage_version.hpp"
|
||||
#include "credentials/policy/policies.hpp"
|
||||
#include "datalake/datalake_utilities.hpp"
|
||||
#include "http/curl/curl.hpp"
|
||||
@ -125,6 +126,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_blockBlobClient(m_blobClient.GetBlockBlobClient())
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -150,6 +153,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_blockBlobClient(m_blobClient.GetBlockBlobClient())
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -173,6 +178,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
: PathClient(fileUri, options), m_blockBlobClient(m_blobClient.GetBlockBlobClient())
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
|
||||
@ -3,12 +3,13 @@
|
||||
|
||||
#include "datalake/file_system_client.hpp"
|
||||
|
||||
#include "blobs/internal/protocol/blob_rest_client.hpp"
|
||||
#include "blobs/protocol/blob_rest_client.hpp"
|
||||
#include "common/common_headers_request_policy.hpp"
|
||||
#include "common/constants.hpp"
|
||||
#include "common/crypt.hpp"
|
||||
#include "common/shared_key_policy.hpp"
|
||||
#include "common/storage_common.hpp"
|
||||
#include "common/storage_version.hpp"
|
||||
#include "credentials/policy/policies.hpp"
|
||||
#include "datalake/datalake_utilities.hpp"
|
||||
#include "datalake/directory_client.hpp"
|
||||
@ -66,6 +67,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
{
|
||||
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -94,6 +97,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
GetBlobContainerClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -122,6 +127,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
GetBlobContainerClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include "common/crypt.hpp"
|
||||
#include "common/shared_key_policy.hpp"
|
||||
#include "common/storage_common.hpp"
|
||||
#include "common/storage_version.hpp"
|
||||
#include "credentials/policy/policies.hpp"
|
||||
#include "datalake/datalake_utilities.hpp"
|
||||
#include "http/curl/curl.hpp"
|
||||
@ -106,6 +107,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_blobClient(Details::GetBlobUriFromUri(pathUri), credential, GetBlobClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -131,6 +134,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_blobClient(Details::GetBlobUriFromUri(pathUri), credential, GetBlobClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -155,6 +160,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_blobClient(Details::GetBlobUriFromUri(pathUri), GetBlobClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
|
||||
@ -3,12 +3,13 @@
|
||||
|
||||
#include "datalake/service_client.hpp"
|
||||
|
||||
#include "blobs/internal/protocol/blob_rest_client.hpp"
|
||||
#include "blobs/protocol/blob_rest_client.hpp"
|
||||
#include "common/common_headers_request_policy.hpp"
|
||||
#include "common/constants.hpp"
|
||||
#include "common/shared_key_policy.hpp"
|
||||
#include "common/storage_common.hpp"
|
||||
#include "common/storage_credential.hpp"
|
||||
#include "common/storage_version.hpp"
|
||||
#include "credentials/policy/policies.hpp"
|
||||
#include "datalake/datalake_utilities.hpp"
|
||||
#include "datalake/file_system_client.hpp"
|
||||
@ -73,6 +74,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
GetBlobServiceClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -100,6 +103,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
GetBlobServiceClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
@ -125,6 +130,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
GetBlobServiceClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
|
||||
for (const auto& p : options.PerOperationPolicies)
|
||||
{
|
||||
policies.emplace_back(p->Clone());
|
||||
|
||||
@ -29,15 +29,14 @@ add_executable (
|
||||
datalake/directory_client_test.hpp
|
||||
datalake/directory_client_test.cpp
|
||||
common/bearer_token_test.cpp
|
||||
main.cpp
|
||||
)
|
||||
)
|
||||
|
||||
target_include_directories(azure-storage-test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
target_link_libraries(azure-storage-test PRIVATE azure-storage)
|
||||
target_link_libraries(azure-storage-test PUBLIC azure::storage::blob azure::storage::file::datalake)
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(azure-storage-test PRIVATE /wd6326 /wd26495 /wd26812)
|
||||
target_compile_options(azure-storage-test PUBLIC /wd6326 /wd26495 /wd26812)
|
||||
endif()
|
||||
|
||||
add_gtest(azure-storage-test)
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user