azure-messaging-eventhubs
Loading...
Searching...
No Matches
checkpoint_store.hpp
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3#pragma once
4#include "models/checkpoint_store_models.hpp"
5
6#include <azure/core/context.hpp>
7#include <azure/core/datetime.hpp>
8#include <azure/core/nullable.hpp>
9
10#include <sstream>
11#include <stdexcept>
12#include <vector>
13
14namespace Azure { namespace Messaging { namespace EventHubs {
15
20 public:
21 CheckpointStore() = default;
22
25 CheckpointStore(CheckpointStore const& other) = default;
26
29 CheckpointStore& operator=(CheckpointStore const& other) = default;
30
34 virtual std::vector<Models::Ownership> ClaimOwnership(
35 std::vector<Models::Ownership> const& partitionOwnership,
36 Core::Context const& context = {})
37 = 0;
38
41 virtual std::vector<Models::Checkpoint> ListCheckpoints(
42 std::string const& fullyQualifiedNamespace,
43 std::string const& eventHubName,
44 std::string const& consumerGroup,
45 Core::Context const& context = {})
46 = 0;
47
50 virtual std::vector<Models::Ownership> ListOwnership(
51 std::string const& fullyQualifiedNamespace,
52 std::string const& eventHubName,
53 std::string const& consumerGroup,
54 Core::Context const& context = {})
55 = 0;
56
59 virtual void UpdateCheckpoint(
60 Models::Checkpoint const& checkpoint,
61 Core::Context const& context = {})
62 = 0;
63
64 virtual ~CheckpointStore() = default;
65 };
66
67}}} // namespace Azure::Messaging::EventHubs
CheckpointStore is used by multiple consumers to coordinate progress and ownership for partitions.
Definition checkpoint_store.hpp:19
virtual void UpdateCheckpoint(Models::Checkpoint const &checkpoint, Core::Context const &context={})=0
UpdateCheckpoint updates a specific checkpoint with a sequence and offset.
virtual std::vector< Models::Checkpoint > ListCheckpoints(std::string const &fullyQualifiedNamespace, std::string const &eventHubName, std::string const &consumerGroup, Core::Context const &context={})=0
ListCheckpoints lists all the available checkpoints.
CheckpointStore(CheckpointStore const &other)=default
Construct a CheckpointStore from another CheckpointStore.
virtual std::vector< Models::Ownership > ClaimOwnership(std::vector< Models::Ownership > const &partitionOwnership, Core::Context const &context={})=0
ClaimOwnership attempts to claim ownership of the partitions in partitionOwnership and returns the ac...
CheckpointStore & operator=(CheckpointStore const &other)=default
Construct a CheckpointStore from another CheckpointStore.
virtual std::vector< Models::Ownership > ListOwnership(std::string const &fullyQualifiedNamespace, std::string const &eventHubName, std::string const &consumerGroup, Core::Context const &context={})=0
ListOwnership lists all ownerships.
Checkpoint tracks the last successfully processed event in a partition.
Definition checkpoint_store_models.hpp:45