You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2021/12/16 13:55:50 UTC

[tinkerpop] branch master updated (7037b00 -> 0dd3c0b)

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git.


    from 7037b00  Merge pull request #1514 from apache/TINKERPOP-2635
     add 18bdf7d  change aiohttp requirements due to vulnerability issue at 3.7.4
     new 11f2b6e  Merge branch 'pr-1519' into 3.5-dev
     add 6f45069  Source: [1] Added transaction profile to pom.xml [2] Made DriverRemoteConnection latch parameters so they can be reused to create a subsequent session [3] Added logging throughout the driver [4] Added commit and rollback to DriverRemoteConnection [5] Added some logging to receive message [6] Added transaction support to RemoteConnection [7] Added bytecode support to Session processor [8] Fixed bug in aiohttp transport layer that popped up when it was not shutdown properl [...]
     add dd796be  [1] Fixed TEST_TRANSACTION environment variable [2] Enabling transaction tests in GitHub actions
     add 2594cf5  [1] Added session support to string messages. This was unintentionally removed.
     add d1e3abd  Added submitAsync in Client and DriverRemoteConnection with deprecated message Fixed missing session close in Client Switched info to debug log for heavy spam messages Added gremlin-variant remote transaction documentation for gremlin-python Added release documentation for remote transactions in gremlin-python
     add 5a0a835  Changed logic for disabling transactions within tests.
     new fee9056  Merge branch 'pr-1515' into 3.5-dev
     new 0dd3c0b  Merge branch '3.5-dev'

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/build-test.yml                   |   2 +-
 CHANGELOG.asciidoc                                 |   3 +
 docs/src/reference/gremlin-variants.asciidoc       |  31 +++
 docs/src/upgrade/release-3.5.x.asciidoc            |  17 +-
 gremlin-python/pom.xml                             | 122 +++++++++++
 .../gremlin_python/driver/aiohttp/transport.py     |  15 +-
 .../main/python/gremlin_python/driver/client.py    |  58 +++--
 .../driver/driver_remote_connection.py             |  70 +++++-
 .../main/python/gremlin_python/driver/protocol.py  |  18 +-
 .../gremlin_python/driver/remote_connection.py     |  23 +-
 .../python/gremlin_python/driver/serializer.py     |  13 +-
 .../gremlin_python/process/graph_traversal.py      |  99 ++++++++-
 .../python/gremlin_python/process/traversal.py     |  18 +-
 gremlin-python/src/main/python/setup.py            |   2 +-
 gremlin-python/src/main/python/tests/conftest.py   |  35 ++-
 .../src/main/python/tests/driver/test_client.py    |  10 +-
 .../main/python/tests/process/test_traversal.py    | 237 ++++++++++++++++++++-
 17 files changed, 706 insertions(+), 67 deletions(-)

[tinkerpop] 02/03: Merge branch 'pr-1515' into 3.5-dev

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit fee9056a2b1c4fec3d736a2b0a41025fd24e4b65
Merge: 11f2b6e 5a0a835
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Thu Dec 16 08:25:03 2021 -0500

    Merge branch 'pr-1515' into 3.5-dev

 .github/workflows/build-test.yml                   |   2 +-
 CHANGELOG.asciidoc                                 |   3 +
 docs/src/reference/gremlin-variants.asciidoc       |  31 +++
 docs/src/upgrade/release-3.5.x.asciidoc            |  17 +-
 gremlin-python/pom.xml                             | 122 +++++++++++
 .../gremlin_python/driver/aiohttp/transport.py     |  15 +-
 .../main/python/gremlin_python/driver/client.py    |  58 +++--
 .../driver/driver_remote_connection.py             |  72 ++++++-
 .../main/python/gremlin_python/driver/protocol.py  |  18 +-
 .../gremlin_python/driver/remote_connection.py     |  23 +-
 .../python/gremlin_python/driver/serializer.py     |  13 +-
 .../gremlin_python/process/graph_traversal.py      | 100 ++++++++-
 .../python/gremlin_python/process/traversal.py     |  18 +-
 gremlin-python/src/main/python/tests/conftest.py   |  35 ++-
 .../src/main/python/tests/driver/test_client.py    |  10 +-
 .../main/python/tests/process/test_traversal.py    | 237 ++++++++++++++++++++-
 16 files changed, 706 insertions(+), 68 deletions(-)


[tinkerpop] 03/03: Merge branch '3.5-dev'

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 0dd3c0b1aa5704f493840211a45bb4fa000b634d
Merge: 7037b00 fee9056
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Thu Dec 16 08:55:35 2021 -0500

    Merge branch '3.5-dev'

 .github/workflows/build-test.yml                   |   2 +-
 CHANGELOG.asciidoc                                 |   3 +
 docs/src/reference/gremlin-variants.asciidoc       |  31 +++
 docs/src/upgrade/release-3.5.x.asciidoc            |  17 +-
 gremlin-python/pom.xml                             | 122 +++++++++++
 .../gremlin_python/driver/aiohttp/transport.py     |  15 +-
 .../main/python/gremlin_python/driver/client.py    |  58 +++--
 .../driver/driver_remote_connection.py             |  70 +++++-
 .../main/python/gremlin_python/driver/protocol.py  |  18 +-
 .../gremlin_python/driver/remote_connection.py     |  23 +-
 .../python/gremlin_python/driver/serializer.py     |  13 +-
 .../gremlin_python/process/graph_traversal.py      |  99 ++++++++-
 .../python/gremlin_python/process/traversal.py     |  18 +-
 gremlin-python/src/main/python/setup.py            |   2 +-
 gremlin-python/src/main/python/tests/conftest.py   |  35 ++-
 .../src/main/python/tests/driver/test_client.py    |  10 +-
 .../main/python/tests/process/test_traversal.py    | 237 ++++++++++++++++++++-
 17 files changed, 706 insertions(+), 67 deletions(-)

diff --cc gremlin-python/pom.xml
index fd9ff26,bbaa75e..90d73e2
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@@ -262,10 -267,10 +267,15 @@@ limitations under the License
                              </dependency>
                              <dependency>
                                  <groupId>org.apache.tinkerpop</groupId>
 +                                <artifactId>gremlin-language</artifactId>
 +                                <version>${project.version}</version>
 +                            </dependency>
 +                            <dependency>
++                                <groupId>org.apache.tinkerpop</groupId>
+                                 <artifactId>neo4j-gremlin</artifactId>
+                                 <version>${project.version}</version>
+                             </dependency>
+                             <dependency>
                                  <groupId>org.codehaus.groovy</groupId>
                                  <artifactId>groovy-all</artifactId>
                                  <version>${groovy.version}</version>
diff --cc gremlin-python/src/main/python/gremlin_python/driver/client.py
index 2773fd2,dca193b..725153a
--- a/gremlin-python/src/main/python/gremlin_python/driver/client.py
+++ b/gremlin-python/src/main/python/gremlin_python/driver/client.py
@@@ -69,10 -71,9 +71,10 @@@ class Client
                  self._message_serializer,
                  username=self._username,
                  password=self._password,
 -                kerberized_service=kerberized_service)
 +                kerberized_service=kerberized_service,
 +                max_content_length=transport_kwargs["max_content_length"])
          self._protocol_factory = protocol_factory
-         if self._sessionEnabled:
+         if self._session_enabled:
              if pool_size is None:
                  pool_size = 1
              elif pool_size != 1:
diff --cc gremlin-python/src/main/python/gremlin_python/process/graph_traversal.py
index 770821e,3918be8..525bc9d
--- a/gremlin-python/src/main/python/gremlin_python/process/graph_traversal.py
+++ b/gremlin-python/src/main/python/gremlin_python/process/graph_traversal.py
@@@ -144,7 -168,7 +168,7 @@@ class GraphTraversal(Traversal)
              if low == long(0):
                  return self.limit(high)
              else:
-                 return self.range_(low,high)
 -                return self.range(low, high)
++                return self.range_(low, high)
          else:
              raise TypeError("Index must be int or slice")
  
@@@ -958,7 -1000,96 +982,70 @@@ class __(object, metaclass=MagicType)
      def where(cls, *args):
          return cls.graph_traversal(None, None, Bytecode()).where(*args)
  
 -    # Deprecated - prefer the underscore suffixed versions e.g filter_()
 -
 -    @classmethod
 -    def filter(cls, *args):
 -        return cls.graph_traversal(None, None, Bytecode()).filter_(*args)
 -
 -    @classmethod
 -    def id(cls, *args):
 -        return cls.graph_traversal(None, None, Bytecode()).id_(*args)
 -
 -    @classmethod
 -    def max(cls, *args):
 -        return cls.graph_traversal(None, None, Bytecode()).max_(*args)
 -
 -    @classmethod
 -    def min(cls, *args):
 -        return cls.graph_traversal(None, None, Bytecode()).min_(*args)
 -
 -    @classmethod
 -    def range(cls, *args):
 -        return cls.graph_traversal(None, None, Bytecode()).range_(*args)
 -
 -    @classmethod
 -    def sum(cls, *args):
 -        return cls.graph_traversal(None, None, Bytecode()).sum_(*args)
 -
  
+ # Class to handle transactions.
+ class Transaction:
+ 
+     def __init__(self, g, remote_connection):
+         self._g = g
+         self._session_based_connection = None
+         self._remote_connection = remote_connection
+         self.__is_open = False
+         self.__mutex = Lock()
+ 
+     # Begins transaction.
+     def begin(self):
+         with self.__mutex:
+             # Verify transaction is not open.
+             self.__verify_transaction_state(False, "Transaction already started on this object")
+ 
+             # Create new session using the remote connection.
+             self._session_based_connection = self._remote_connection.create_session()
+             self.__is_open = True
+ 
+             # Set the session as a remote strategy within the traversal strategy.
+             traversal_strategy = TraversalStrategies()
+             traversal_strategy.add_strategies([RemoteStrategy(self._session_based_connection)])
+ 
+             # Return new GraphTraversalSource.
+             return GraphTraversalSource(self._g.graph, traversal_strategy, self._g.bytecode)
+ 
+     # Rolls transaction back.
+     def rollback(self):
+         with self.__mutex:
+             # Verify transaction is open, close session and return result of transaction's rollback.
+             self.__verify_transaction_state(True, "Cannot commit a transaction that is not started.")
+             return self.__close_session(self._session_based_connection.rollback())
+ 
+     # Commits the current transaction.
+     def commit(self):
+         with self.__mutex:
+             # Verify transaction is open, close session and return result of transaction's commit.
+             self.__verify_transaction_state(True, "Cannot commit a transaction that is not started.")
+             return self.__close_session(self._session_based_connection.commit())
+ 
+     # Closes session.
+     def close(self):
+         with self.__mutex:
+             # Verify transaction is open.
+             self.__verify_transaction_state(True, "Cannot close a transaction that has previously been closed.")
+             self.__close_session(None)
+ 
+     # Return whether or not transaction is open.
+     # Allow camelcase function here to keep api consistent with other languages.
+     def isOpen(self):
+         return self.__is_open
+ 
+     def __verify_transaction_state(self, state, error_message):
+         if self.__is_open != state:
+             raise Exception(error_message)
+ 
+     def __close_session(self, session):
+         self._session_based_connection.close()
+         self.__is_open = False
+         return session
+ 
+ 
  def V(*args):
      return __.V(*args)
  

[tinkerpop] 01/03: Merge branch 'pr-1519' into 3.5-dev

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 11f2b6ede0e8ca7d6736783f624e95af16079871
Merge: 459067c 18bdf7d
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Thu Dec 16 08:22:27 2021 -0500

    Merge branch 'pr-1519' into 3.5-dev

 gremlin-python/src/main/python/setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)