-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Event Hubs] Port azure storage blob code into checkpointstore #9950
Conversation
/azp run python - eventhubs - ci |
Pull request contains merge conflicts. |
/azp run python - eventhubs - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -97,6 +97,20 @@ if __name__ == '__main__': | |||
loop.run_until_complete(main()) | |||
``` | |||
|
|||
#### Use `BlobCheckpointStore` with a different version of Azure Storage Service API | |||
Some environments have different versions of Azure Storage Service API. For instance, some Azure Stack use 2017-11-09. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"some Azure Stack deployments"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we have other deployments that are not Azure Stack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case I would change it to "For instance, Azure Stack may use...."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
...heckpointstoreblob-aio/azure/eventhub/extensions/checkpointstoreblobaio/_blobstoragecsaio.py
Show resolved
Hide resolved
if headers: | ||
headers["x-ms-version"] = api_version | ||
else: | ||
kwargs["headers"] = {"x-ms-version": api_version} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could simplify:
headers = kwargs.get("headers") or {}
headers["x-ms-version"] = api_version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to this
loop = asyncio.get_event_loop() | ||
checkpoint_store = BlobCheckpointStore.from_connection_string( | ||
STORAGE_CONNECTION_STR, | ||
container_name=BLOB_CONTAINER_NAME, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API version sample doesn't use API version :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -2,6 +2,9 @@ | |||
|
|||
## 1.0.1 (Unreleased) | |||
|
|||
**New features** | |||
- Param `api_version` of `BlobPartitionManager` now supports older versions of Azure Storage Serice API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "Service"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. good catch
/azp run python - eventhubs - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
This PR is for issue #7808 - Remove checkpointstore's dependency on azure blob storage.
An example is the latest azure-storage-blob SDK v12.x supports storage service API 2019-02-02 and 2019-07-07. But Azure Stack's storage service API version is 2017-11-09. So lib azure-eventhub-checkpointstoreblob and azure-eventhub-checkpointblob-aio can't work on Azure Stack.
This PR is to port the latest storage blob SDK code to the two checkpointstore libs and make it to be compatible with storage 2017-11-09. And this doesn't introduce a break change to the user.
These changes are made:
An Azure Stack user will need to specify storage service api_version when creating an BlobCheckpointStore if the api_version isn't the latest version.