Skip to content

Commit 1fc5d32

Browse files
authored
GG-33857 [IGNITE-12467] Transactions, rewrite async connections (#49)
(cherry picked from commit 9945ecb)
1 parent 977126e commit 1fc5d32

38 files changed

+1110
-687
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/source/pygridgain.datatypes.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
limitations under the License.
1414
1515
pygridgain.datatypes package
16-
============================
16+
==========================
1717

1818
.. automodule:: pygridgain.datatypes
1919
:members:
@@ -30,6 +30,8 @@ Submodules
3030
pygridgain.datatypes.cache_config
3131
pygridgain.datatypes.cache_properties
3232
pygridgain.datatypes.complex
33+
pygridgain.datatypes.cluster_state
34+
pygridgain.datatypes.expiry_policy
3335
pygridgain.datatypes.internal
3436
pygridgain.datatypes.key_value
3537
pygridgain.datatypes.null_object
@@ -38,4 +40,3 @@ Submodules
3840
pygridgain.datatypes.primitive_objects
3941
pygridgain.datatypes.sql
4042
pygridgain.datatypes.standard
41-
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. Copyright 2021 GridGain Systems, Inc. and Contributors.
2+
3+
.. Licensed under the GridGain Community Edition License (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
.. https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license
8+
9+
.. Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
15+
pygridgain.datatypes.transactions module
16+
=======================================
17+
18+
.. automodule:: pygridgain.datatypes.transactions
19+
:members:
20+
:show-inheritance:

docs/source/pygridgain.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
limitations under the License.
1414
1515
pygridgain package
16-
==================
16+
================
1717

1818
.. automodule:: pygridgain
1919
:members:
@@ -38,6 +38,9 @@ Submodules
3838
pygridgain.aio_cache
3939
pygridgain.client
4040
pygridgain.aio_client
41+
pygridgain.cluster
42+
pygridgain.aio_cluster
43+
pygridgain.transaction
4144
pygridgain.cursors
4245
pygridgain.exceptions
4346

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,10 @@
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
1414
15-
pygridgain package
16-
================
15+
pygridgain.transaction module
16+
=========================
1717

18-
.. automodule:: pygridgain
18+
.. automodule:: pygridgain.transaction
1919
:members:
2020
:undoc-members:
2121
:show-inheritance:
22-
23-
Subpackages
24-
-----------
25-
26-
.. toctree::
27-
28-
pygridgain.datatypes
29-
pygridgain.connection
30-
31-
Submodules
32-
----------
33-
34-
.. toctree::
35-
36-
pygridgain.binary
37-
pygridgain.cache
38-
pygridgain.aio_cache
39-
pygridgain.client
40-
pygridgain.aio_client
41-
pygridgain.cluster
42-
pygridgain.aio_cluster
43-
pygridgain.cursors
44-
pygridgain.exceptions
45-

docs/source/pyignite.datatypes.rst

Lines changed: 0 additions & 42 deletions
This file was deleted.

pygridgain/aio_cache.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import asyncio
1717
from typing import Any, Iterable, Optional, Union
1818

19+
from .api.tx_api import get_tx_connection
1920
from .datatypes import ExpiryPolicy
2021
from .datatypes.internal import AnyDataObject
2122
from .exceptions import CacheCreationError, CacheError, ParameterError
@@ -92,6 +93,9 @@ def __init__(self, client: 'AioClient', name: str, expiry_policy: ExpiryPolicy =
9293
super().__init__(client, name, expiry_policy)
9394

9495
async def _get_best_node(self, key=None, key_hint=None):
96+
tx_conn = get_tx_connection()
97+
if tx_conn:
98+
return tx_conn
9599
return await self.client.get_best_node(self, key, key_hint)
96100

97101
async def settings(self) -> Optional[dict]:

0 commit comments

Comments
 (0)