Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e855fc4
Removed storage dependency from eventhubs
LarryOsterman Sep 14, 2023
1cae340
fixed issue in test cmakelists.txt
LarryOsterman Sep 14, 2023
38d6cb8
Renamed blob checkpointstore test to remove CI ambiguity
LarryOsterman Sep 14, 2023
0ab19bd
Updated checkpoint
LarryOsterman Sep 14, 2023
4f34723
Load gtest from include path not current dir
LarryOsterman Sep 14, 2023
2e35ba4
clang-format; added checkpoint store test
LarryOsterman Sep 15, 2023
90455ee
shortened the name of checkpoint store test
LarryOsterman Sep 15, 2023
b3f233b
SShortened name of blob checkpoint package location
LarryOsterman Sep 15, 2023
f0ef8ac
Moved name of blob checkpoint package location back
LarryOsterman Sep 15, 2023
91f69da
Only include tests when building tests
LarryOsterman Sep 15, 2023
0fe2c28
Hook checkpoitn store blobs to eventhubs correctly
LarryOsterman Sep 15, 2023
b6cf1b3
clang-format
LarryOsterman Sep 15, 2023
73e7648
Some live tests don't need to be live only
LarryOsterman Sep 15, 2023
ae96e7f
Added readme and changelog for checkpoint store; removed more storage…
LarryOsterman Sep 15, 2023
0b6e929
Fixed link
LarryOsterman Sep 15, 2023
8990318
Update sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/C…
LarryOsterman Sep 15, 2023
3d7253d
FolderList.cmake updates for blob storage
LarryOsterman Sep 18, 2023
03285b2
fixed dllimport_export.hpp #define values
LarryOsterman Sep 18, 2023
1d45e47
CI tweaks
LarryOsterman Sep 18, 2023
c1a30af
diagnostics for otel failure
LarryOsterman Sep 18, 2023
b416f81
more fetch_sources_deps fixes
LarryOsterman Sep 18, 2023
37cede1
updated dependencies for eventhubs
LarryOsterman Sep 18, 2023
6273305
EH and blob checkpoint depend on identity
LarryOsterman Sep 18, 2023
b200f56
eh core doesn't need storage dependency
LarryOsterman Sep 18, 2023
40c2bf7
Removed identity dependency for eventhubs; disable otel for eventhubs…
LarryOsterman Sep 18, 2023
bd4d6eb
Disable FETCH_SOURCE_DEPS until azure SDK baseline is updated
LarryOsterman Sep 18, 2023
245f355
removed eventhubs from checkpointstore vcpkg.json
LarryOsterman Sep 18, 2023
6b9d203
noise reduction - removed debugging stuff
LarryOsterman Sep 18, 2023
e3b66d2
Reset vcpkg checkpoint to a commit including eventhubs
LarryOsterman Sep 19, 2023
4b0b3c9
Fixed cmake line for disabling otel
LarryOsterman Sep 19, 2023
073619f
Fixed path for blob checkpoint store
LarryOsterman Sep 19, 2023
8f8c3a6
New name for blob checkpoint store
LarryOsterman Sep 19, 2023
fb66a06
doxygen fixes
LarryOsterman Sep 19, 2023
2d27f21
Reverted otel change
LarryOsterman Sep 19, 2023
56420de
Updated checkpoint store name to match location on disk
LarryOsterman Sep 19, 2023
fa8094e
Fixed path for doxygen
LarryOsterman Sep 19, 2023
8f06822
update recordings
LarryOsterman Sep 20, 2023
66358df
Merge branch 'main' into larryo/removeehstoragedependency
LarryOsterman Sep 21, 2023
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
26 changes: 26 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@
},
"architecture": "win32"
},
{
"name": "x64-msvc-static",
"displayName": "Windows x64 MSVC Static",
"description": "Windows Default, MSVC, x64 architecture.",
"inherits": "msvc-windows-default",
"hidden": true,
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows-static",
"MSVC_USE_STATIC_CRT": true
},
"architecture": {
"value": "x64",
"strategy": "external"
}
},

{
"name": "x64",
"displayName": "Windows x64",
Expand Down Expand Up @@ -305,6 +321,16 @@
"displayName": "x86 MSVC Debug static With Perf Tests and samples",
"inherits": [ "x86-msvc-static", "debug-build", "enable-tests", "enable-perf", "enable-samples", "curl-transport", "winhttp-transport" ]
},
{
"name": "x64-msvc-static-debug-perftests",
"displayName": "x64 MSVC Debug static With Perf Tests and samples",
"inherits": [ "x64-msvc-static", "debug-build", "enable-tests", "enable-perf", "enable-samples", "curl-transport", "winhttp-transport" ]
},
{
"name": "x64-msvc-static-release-perftests",
"displayName": "x64 MSVC Release static With Perf Tests and samples",
"inherits": [ "x64-msvc-static", "release-build", "enable-tests", "enable-perf", "enable-samples", "curl-transport", "winhttp-transport" ]
},
{
"name": "x64-static-release-perftests",
"displayName": "x64 Release With Perf Tests, static",
Expand Down
2 changes: 1 addition & 1 deletion cmake-modules/AzureDoxygen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Usage: generate_documentation(azure-core 1.0.0-preview.1)
# Requires: Doxygen
# Target name in the form of ${PROJECT_NAME}-docs (e.g. azure-core-docs)

# Note that PROJECT_NAME is also the directory containing the package.
function(generate_documentation PROJECT_NAME PROJECT_VERSION)
if(BUILD_DOCUMENTATION)
find_package(Doxygen 1.9.7 REQUIRED doxygen)
Expand Down
3 changes: 2 additions & 1 deletion cmake-modules/AzureVcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(AZ_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..")

macro(az_vcpkg_integrate)
message("Vcpkg integrate step.")

# AUTO CMAKE_TOOLCHAIN_FILE:
# User can call `cmake -DCMAKE_TOOLCHAIN_FILE="path_to_the_toolchain"` as the most specific scenario.
# As the last alternative (default case), Azure SDK will automatically clone VCPKG folder and set toolchain from there.
Expand All @@ -17,7 +18,7 @@ macro(az_vcpkg_integrate)
message("AZURE_SDK_DISABLE_AUTO_VCPKG is not defined. Fetch a local copy of vcpkg.")
# GET VCPKG FROM SOURCE
# User can set env var AZURE_SDK_VCPKG_COMMIT to pick the VCPKG commit to fetch
set(VCPKG_COMMIT_STRING dafef74af53669ef1cc9015f55e0ce809ead62aa) # default SDK tested commit
set(VCPKG_COMMIT_STRING 33409307f1e3411112a0a6bbf3011ea3cca1bfc9) # default SDK tested commit
if(DEFINED ENV{AZURE_SDK_VCPKG_COMMIT})
message("AZURE_SDK_VCPKG_COMMIT is defined. Using that instead of the default.")
set(VCPKG_COMMIT_STRING "$ENV{AZURE_SDK_VCPKG_COMMIT}") # default SDK tested commit
Expand Down
4 changes: 4 additions & 0 deletions cmake-modules/FolderList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ macro(GetFolderList project)
elseif(${project} STREQUAL EVENTHUBS)
DownloadDepVersion(sdk/core azure-core 1.10.1)
DownloadDepVersion(sdk/core azure-core-amqp 1.0.0-beta.1)
elseif(${project} STREQUAL EVENTHUBS_CHECKPOINT_BLOB)
DownloadDepVersion(sdk/core azure-core 1.10.1)
DownloadDepVersion(sdk/core azure-core-amqp 1.0.0-beta.1)
DownloadDepVersion(sdk/eventhubs azure-messaging-eventhubs 1.0.0-beta.3)
DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.3.3)
DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.8.0)
endif()
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ jobs:
}
displayName: Copy CHANGELOG.md to package artifact

- script: cmake --build . --target ${{ artifact.Name }}-docs
- script: cmake --build . --target ${{ artifact.Path }}-docs
workingDirectory: build
displayName: Generate docs (${{ artifact.Name }}-docs)

Expand Down
2 changes: 2 additions & 0 deletions sdk/eventhubs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

add_subdirectory(azure-messaging-eventhubs)
#add_subdirectory(azure-messaging-eventhubs-checkpointstore-blob)
add_subdirectory(blob-store)
2 changes: 1 addition & 1 deletion sdk/eventhubs/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "cpp",
"TagPrefix": "cpp/eventhubs",
"Tag": "cpp/eventhubs_ea4655bf2e"
"Tag": "cpp/eventhubs_d59a0a9f3c"
}
6 changes: 1 addition & 5 deletions sdk/eventhubs/azure-messaging-eventhubs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ elseif(NOT AZ_ALL_LIBRARIES)
find_package(azure-core-amqp-cpp REQUIRED)
endif()

find_package(azure-storage-blobs-cpp CONFIG QUIET)
if(NOT azure-storage-blobs-cpp_FOUND)
find_package(azure-storage-blobs-cpp REQUIRED)
endif()
endif()

set(
Expand Down Expand Up @@ -110,7 +106,7 @@ target_include_directories(
$<INSTALL_INTERFACE:include>
)

target_link_libraries(azure-messaging-eventhubs PUBLIC Azure::azure-core Azure::azure-core-amqp Azure::azure-storage-blobs)
target_link_libraries(azure-messaging-eventhubs PUBLIC Azure::azure-core Azure::azure-core-amqp)

# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
create_code_coverage(eventhubs azure-messaging-eventhubs azure-messaging-eventhubs-test "tests?/*;samples?/*")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <azure/core/context.hpp>
#include <azure/core/datetime.hpp>
#include <azure/core/nullable.hpp>
#include <azure/storage/blobs.hpp>

#include <sstream>
#include <stdexcept>
Expand Down Expand Up @@ -65,68 +64,4 @@ namespace Azure { namespace Messaging { namespace EventHubs {
virtual ~CheckpointStore() = default;
};

/** @brief BlobCheckpointStore is an implementation of a CheckpointStore backed by Azure Blob
* Storage.
*/
class BlobCheckpointStore final : public CheckpointStore {
Azure::Storage::Blobs::BlobContainerClient m_containerClient;

void UpdateCheckpointImpl(
Azure::Storage::Metadata const& metadata,
Models::Checkpoint& checkpoint);

void UpdateOwnership(
Azure::Storage::Blobs::Models::BlobItem const& blob,
Models::Ownership& ownership);

Azure::Storage::Metadata CreateCheckpointBlobMetadata(Models::Checkpoint const& checkpoint);

std::pair<Azure::DateTime, Azure::ETag> SetMetadata(
std::string const& blobName,
Azure::Storage::Metadata const& metadata,
Azure::ETag const& etag,
Core::Context const& context = {});

public:
/** @brief Construct a BlobCheckpointStore from another BlobCheckpointStore.
*/
BlobCheckpointStore(BlobCheckpointStore const& other) = default;

/** @brief Assign a BlobCheckpointStore to another BlobCheckpointStore.
*/
BlobCheckpointStore& operator=(BlobCheckpointStore const& other) = default;

/**@brief Construct a BlobCheckpointStore.
*
* @param containerClient An Azure Blob ContainerClient used to hold the checkpoints.
*/
BlobCheckpointStore(Azure::Storage::Blobs::BlobContainerClient const& containerClient)
: CheckpointStore(), m_containerClient(containerClient)
{
m_containerClient.CreateIfNotExists();
}

std::vector<Models::Ownership> ClaimOwnership(
std::vector<Models::Ownership> const& partitionOwnership,
Core::Context const& context = {}) override;

std::vector<Models::Checkpoint> ListCheckpoints(
std::string const& fullyQualifiedNamespace,
std::string const& eventHubName,
std::string const& consumerGroup,
Core::Context const& context = {}) override;

/**@brief ListOwnership lists all ownerships.
*/
std::vector<Models::Ownership> ListOwnership(
std::string const& fullyQualifiedNamespace,
std::string const& eventHubName,
std::string const& consumerGroup,
Core::Context const& context = {}) override;

/**@brief UpdateCheckpoint updates a specific checkpoint with a sequence and offset.
*/
void UpdateCheckpoint(Models::Checkpoint const& checkpoint, Core::Context const& context = {})
override;
};
}}} // namespace Azure::Messaging::EventHubs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#pragma once
#include <azure/core/context.hpp>
#include <azure/core/datetime.hpp>
#include <azure/core/etag.hpp>
#include <azure/core/nullable.hpp>
#include <azure/storage/blobs.hpp>

#include <sstream>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace Azure { namespace Messaging { namespace EventHubs {
*
* @param context The context to control the request lifetime.
*/
void Run(Core::Context const& context = {})
void Run(Core::Context const& context)
{
Models::EventHubProperties eventHubProperties
= m_consumerClient->GetEventHubProperties(context);
Expand All @@ -140,12 +140,12 @@ namespace Azure { namespace Messaging { namespace EventHubs {
// = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
// const auto current = std::chrono::system_clock::from_time_t(timeNowSeconds);

// TODO : this is where we re load balance on the update interval
/* while (!context.IsCancelled())
{
std::this_thread::sleep_for(m_ownershipUpdateInterval);
Dispatch(eventHubProperties, consumers, context);
}*/
//// TODO : this is where we re load balance on the update interval
// while (!context.IsCancelled())
//{
// std::this_thread::sleep_for(m_ownershipUpdateInterval);
// Dispatch(eventHubProperties, consumers, context);
//}
}

/** @brief Dispatches events to the appropriate partition clients.
Expand Down
Loading