FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(x-goog-spanner-request-id): introduce AtomicCounter by odeke-em · Pull Request #1275 · googleapis/python-spanner · GitHub

This repository was archived by the owner on Jun 8, 2026. It is now read-only.
/ python-spanner Public archive

feat(x-goog-spanner-request-id): introduce AtomicCounter - #1275

Merged
olavloite merged 4 commits into
googleapis:mainfrom
odeke-em:x-goog-spanner-request-id-AtomicCounter
Dec 19, 2024
Merged

olavloite merged 4 commits into
googleapis:mainfrom
odeke-em:x-goog-spanner-request-id-AtomicCounter

Conversation

Copy link
Copy Markdown
Contributor

This change introduces AtomicCounter, a concurrency/thread-safe counter do deal with the multi-threaded nature of variables. It permits operations:

  • atomic_counter += 1
  • value = atomic_counter + 1
  • atomic_counter.value

that'll be paramount to bringing in the logic for
x-goog-spanner-request-id in much reduced changelists.

Updates googleapis/google-cloud-python#15905
Carved out from PR #1264

This change introduces AtomicCounter, a concurrency/thread-safe
counter do deal with the multi-threaded nature of variables.
It permits operations:
* atomic_counter += 1
* value = atomic_counter + 1
* atomic_counter.value

that'll be paramount to bringing in the logic for
x-goog-spanner-request-id in much reduced changelists.

Updates #1261
Carved out from PR googleapis#1264
odeke-em requested review from a team December 18, 2024 14:23
product-auto-label Bot added the size: m Pull request size is medium. label Dec 18, 2024
product-auto-label Bot added the api: spanner Issues related to the googleapis/python-spanner API. label Dec 18, 2024
Comment thread tests/unit/test_atomic_counter.py Outdated
olavloite added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 19, 2024
yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 19, 2024

Copy link
Copy Markdown
Contributor Author

Thank you for the reivew and approval @olavloite! I've updated the tests too. Kindly please help me run the bots too.

olavloite added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 19, 2024
yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 19, 2024
olavloite added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 19, 2024
yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 19, 2024
olavloite enabled auto-merge (squash) December 19, 2024 19:18
olavloite added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 19, 2024
yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 19, 2024
olavloite merged commit f2483e1 into googleapis:main Dec 19, 2024
odeke-em deleted the x-goog-spanner-request-id-AtomicCounter branch December 19, 2024 20:38
aakashanandg pushed a commit to aakashanandg/python-spanner that referenced this pull request Jan 2, 2025
…1275)

* feat(x-goog-spanner-request-id): introduce AtomicCounter

This change introduces AtomicCounter, a concurrency/thread-safe
counter do deal with the multi-threaded nature of variables.
It permits operations:
* atomic_counter += 1
* value = atomic_counter + 1
* atomic_counter.value

that'll be paramount to bringing in the logic for
x-goog-spanner-request-id in much reduced changelists.

Updates #1261
Carved out from PR googleapis#1264

* Tests for with_request_id

* chore: remove sleep

* chore: remove unused import

---------

Co-authored-by: Knut Olav Løite <koloite@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spanner Issues related to the googleapis/python-spanner API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL