Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of the Checkpointstoragetable #19904

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5069cf0
update
Jul 8, 2021
604c0a7
Merge branch 'josue-branch' of https://github.com/Jg1255/azure-sdk-fo…
Jul 8, 2021
f6f029e
renamed
Jul 8, 2021
85f3c71
add table
Jul 8, 2021
121e3c9
add tablestorage
Jul 8, 2021
d3f0826
add tablestorage
Jul 8, 2021
2e942fc
add readme
Jul 8, 2021
c9f6b7b
Update sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhu…
Jg1255 Jul 9, 2021
7aefb84
Update sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhu…
Jg1255 Jul 9, 2021
a8b2a10
Update sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhu…
Jg1255 Jul 9, 2021
4e9367a
Update sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhu…
Jg1255 Jul 9, 2021
5af24e5
added new methods
Jul 9, 2021
763c3ea
added new methods
Jul 9, 2021
b9cc9ba
Update sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhu…
Jg1255 Jul 12, 2021
1ad7349
Update sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhu…
Jg1255 Jul 12, 2021
f794f9e
Update sdk/eventhub/azure-eventhub-checkpointstoretable/CHANGELOG.md
Jg1255 Jul 12, 2021
9b78093
Update sdk/eventhub/azure-eventhub-checkpointstoretable/setup.py
Jg1255 Jul 14, 2021
636dc7f
Update sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhu…
Jg1255 Jul 14, 2021
81c15ef
version update
Jul 14, 2021
e0e8777
version update
Jul 14, 2021
6bd3b73
new update
Jul 14, 2021
77729d3
update packagename
Jul 14, 2021
d7dbe2b
update
Jul 14, 2021
125d581
newupdate
Jul 14, 2021
e2384eb
template update
Jul 14, 2021
feb4cdd
template update
Jul 14, 2021
a7c943e
template update
Jul 15, 2021
d91a216
template update
Jul 15, 2021
a114e7e
template update
Jul 15, 2021
9e7b326
template update
Jul 15, 2021
232ce96
template update
Jul 15, 2021
55714b4
Update sdk/eventhub/azure-eventhub-checkpointstoretable/README.md
Jg1255 Jul 18, 2021
6b42659
Update sdk/eventhub/azure-eventhub-checkpointstoretable/README.md
Jg1255 Jul 18, 2021
d06cf02
the newest update
Jul 18, 2021
1d04b0f
Update sdk/eventhub/azure-eventhub-checkpointstoretable/setup.py
Jg1255 Jul 18, 2021
73fedf2
removed and updated files
Jul 18, 2021
afcceb1
updated message
Jul 19, 2021
40b1830
updated message
Jul 19, 2021
c9a2c92
updated message
Jul 19, 2021
d882bfd
update on tests
Jul 20, 2021
faa9a62
Update sdk/eventhub/azure-eventhub-checkpointstoretable/MANIFEST.in
Jg1255 Jul 21, 2021
8819a42
Update sdk/eventhub/azure-eventhub-checkpointstoretable/tests/test_st…
Jg1255 Jul 21, 2021
731fb4b
update docs
Jul 21, 2021
443c01d
Merge branch 'josue-branch' of https://github.com/Jg1255/azure-sdk-fo…
Jul 21, 2021
02f71f4
updates on method
Jul 21, 2021
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Release History

## 1.0.0b1 (Unreleased)
- Template package (can update this after implementation is done)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include *.md
include azure/__init__.py
include azure/eventhub/__init__.py
include azure/eventhub/extensions/__init__.py
recursive-include tests *.py
recursive-include samples *.py
41 changes: 41 additions & 0 deletions sdk/eventhub/azure-eventhub-checkpointstoretable/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/azure-sdk-for-python.client?branchName=main)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=46?branchName=main)

# Azure EventHubs Checkpoint Store client library for Python using Tables

Azure EventHubs Checkpoint Store is used for storing checkpoints while processing events from Azure Event Hubs.
This Checkpoint Store package works as a plug-in package to `EventHubConsumerClient`. It uses Azure Tables as the persistent store for maintaining checkpoints and partition ownership information.


# Getting started

### Prerequisites

- Python2.7, Python 3.6 or later.
- **Microsoft Azure Subscription:** To use Azure services, including Azure Event Hubs, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a free trial or use your MSDN subscriber benefits when you [create an account](https://azure.microsoft.com/).

- **Event Hubs namespace with an Event Hub:** To interact with Azure Event Hubs, you'll also need to have a namespace and Event Hub available. If you are not familiar with creating Azure resources, you may wish to follow the step-by-step guide for [creating an Event Hub using the Azure portal](https://docs.microsoft.com/azure/event-hubs/event-hubs-create). There, you can also find detailed instructions for using the Azure CLI, Azure PowerShell, or Azure Resource Manager (ARM) templates to create an Event Hub.

- **Azure Storage Account:** You'll need to have an Azure Storage Account and create a Azure Table Storage to store the checkpoint data with entities. You may follow the guide [creating an Azure Table Storage Account]
(https://docs.microsoft.com/azure/storage/tables/table-storage-overview).

# Key concepts

Bullet point list of your library's main concepts.

# Examples

Examples of some of the key concepts for your library.

# Troubleshooting

Running into issues? This section should contain details as to what to do there.

# Next steps

More sample code should go here, along with links out to the appropriate example tests.

# Contributing

If you encounter any bugs or have suggestions, please file an issue in the [Issues](<https://github.com/Azure/azure-sdk-for-python/issues>) section of the project.

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fsdk%2Feventhub%2Fazure-eventhub-checkpointstoretable%2FREADME.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from ._version import VERSION

__version__ = VERSION

from ._tablestoragecs import TableCheckpointStore

__all__ = [
"TableCheckpointStore",
]

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------

VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-e ../../../tools/azure-sdk-tools
../../core/azure-core
-e ../../../tools/azure-devtools
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[packaging]
auto_update = false
2 changes: 2 additions & 0 deletions sdk/eventhub/azure-eventhub-checkpointstoretable/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
universal=1
76 changes: 76 additions & 0 deletions sdk/eventhub/azure-eventhub-checkpointstoretable/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
from setuptools import setup, find_packages
import os
from io import open
import re

# example setup.py Feel free to copy the entire "azure-template" folder into a package folder named
# with "azure-<yourpackagename>". Ensure that the below arguments to setup() are updated to reflect
# your package.

# this setup.py is set up in a specific way to keep the azure* and azure-mgmt-* namespaces WORKING all the way
# up from python 2.7. Reference here: https://github.com/Azure/azure-sdk-for-python/wiki/Azure-packaging

PACKAGE_NAME = "azure-eventhub-checkpointstoretable"
PACKAGE_PPRINT_NAME = "Event Hubs checkpointer implementation with Azure Table Storage"

# a-b-c => a/b/c
package_folder_path = PACKAGE_NAME.replace("-", "/")
# a-b-c => a.b.c
namespace_name = PACKAGE_NAME.replace("-", ".")

package_folder_path = "azure/eventhub/extensions/checkpointstoretable"

# Version extraction inspired from 'requests'
with open(os.path.join(package_folder_path, "_version.py"), "r") as fd:
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)
if not version:
raise RuntimeError("Cannot find version information")

with open("README.md", encoding="utf-8") as f:
long_description = f.read()

setup(
name=PACKAGE_NAME,
version=version,
description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME),
# ensure that these are updated to reflect the package owners' information
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/Azure/azure-sdk-for-python",
author="Microsoft Corporation",
author_email="azuresdkengsysadmins@microsoft.com",
license="MIT License",
# ensure that the development status reflects the status of your package
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: MIT License",
],
packages=find_packages(
exclude=[
"tests",
# Exclude packages that will be covered by PEP420 or nspkg
# This means any folder structure that only consists of a __init__.py.
# For example, for storage, this would mean adding 'azure.storage'
# in addition to the default 'azure' that is seen here.
"azure",
]
),
install_requires=[
"azure-core<2.0.0,>=1.2.2",
],
extras_require={
":python_version<'3.0'": ["azure-nspkg"],
},
project_urls={
"Bug Reports": "https://github.com/Azure/azure-sdk-for-python/issues",
"Source": "https://github.com/Azure/azure-sdk-python",
},
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import pytest
from azure.eventhub.extensions.checkpointstoretable import TableCheckpointStore

def test_constructor():
client = TableCheckpointStore()
assert client is not None

2 changes: 2 additions & 0 deletions sdk/eventhub/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ extends:
safeName: azureeventhubcheckpointstoreblobaio
- name: azure-eventhub-checkpointstoreblob
safeName: azureeventhubcheckpointstoreblob
- name: azure-eventhub-checkpointstoretable
safeName: azureeventhubcheckpointstoretable
- name: azure-mgmt-eventhub
safeName: azuremgmteventhub