You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by jo...@apache.org on 2017/08/10 15:54:41 UTC

[1/3] tinkerpop git commit: Unwrap AggregateException for sync io operations

Repository: tinkerpop
Updated Branches:
  refs/heads/tp32 55ebe13ed -> 6a3fc39a9


Unwrap AggregateException for sync io operations


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a655e264
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a655e264
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a655e264

Branch: refs/heads/tp32
Commit: a655e2649ab9a6ba1885dde317d81e845a7507b8
Parents: 51caf77
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Wed Aug 9 11:46:28 2017 +0200
Committer: Jorge Bay Gondra <jo...@gmail.com>
Committed: Wed Aug 9 11:56:22 2017 +0200

----------------------------------------------------------------------
 .../src/Gremlin.Net/Driver/ConnectionPool.cs    |  3 +-
 .../Remote/DriverRemoteTraversalSideEffects.cs  |  3 +-
 .../Process/Remote/RemoteStrategy.cs            |  3 +-
 .../src/Gremlin.Net/Structure/Utils.cs          | 55 ++++++++++++++++++++
 .../Process/Remote/RemoteStrategyTests.cs       | 12 +++++
 5 files changed, 73 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a655e264/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPool.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPool.cs b/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPool.cs
index e9ce9a8..98cb547 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPool.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPool.cs
@@ -26,6 +26,7 @@ using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
+using Gremlin.Net.Structure;
 
 namespace Gremlin.Net.Driver
 {
@@ -92,7 +93,7 @@ namespace Gremlin.Net.Driver
                     {
                         if (_connections != null && !_connections.IsEmpty)
                         {
-                            TeardownAsync().Wait();
+                            TeardownAsync().WaitUnwrap();
 
                             foreach (var conn in _connections)
                                 conn.Dispose();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a655e264/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversalSideEffects.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversalSideEffects.cs b/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversalSideEffects.cs
index 8ce495d..e8df942 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversalSideEffects.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversalSideEffects.cs
@@ -26,6 +26,7 @@ using System.Collections.Generic;
 using System.Linq;
 using Gremlin.Net.Driver.Messages;
 using Gremlin.Net.Process.Traversal;
+using Gremlin.Net.Structure;
 
 namespace Gremlin.Net.Driver.Remote
 {
@@ -112,7 +113,7 @@ namespace Gremlin.Net.Driver.Remote
 
         private void CloseSideEffects()
         {
-            _gremlinClient.SubmitAsync<object>(SideEffectCloseMessage()).Wait();
+            _gremlinClient.SubmitAsync<object>(SideEffectCloseMessage()).WaitUnwrap();
         }
 
         private RequestMessage SideEffectCloseMessage()

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a655e264/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs
index b3f8c44..b914063 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs
@@ -23,6 +23,7 @@
 
 using System.Threading.Tasks;
 using Gremlin.Net.Process.Traversal;
+using Gremlin.Net.Structure;
 
 namespace Gremlin.Net.Process.Remote
 {
@@ -46,7 +47,7 @@ namespace Gremlin.Net.Process.Remote
         /// <inheritdoc />
         public void Apply<S, E>(ITraversal<S, E> traversal)
         {
-            ApplyAsync(traversal).Wait();
+            ApplyAsync(traversal).WaitUnwrap();
         }
 
         /// <inheritdoc />

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a655e264/gremlin-dotnet/src/Gremlin.Net/Structure/Utils.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/Utils.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/Utils.cs
new file mode 100644
index 0000000..08168ba
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/Utils.cs
@@ -0,0 +1,55 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System;
+using System.Runtime.ExceptionServices;
+using System.Threading.Tasks;
+
+namespace Gremlin.Net.Structure
+{
+    /// <summary>
+    /// Contains useful methods that can be reused across the project. 
+    /// </summary>
+    internal static class Utils
+    {
+        /// <summary>
+        /// Waits the completion of the provided Task.
+        /// When an AggregateException is thrown, the inner exception is thrown.
+        /// </summary>
+        public static void WaitUnwrap(this Task task)
+        {
+            try
+            {
+                task.Wait();
+            }
+            catch (AggregateException ex)
+            {
+                if (ex.InnerExceptions.Count == 1)
+                {
+                    ExceptionDispatchInfo.Capture(ex.InnerException).Throw();   
+                }
+                throw;
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a655e264/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Remote/RemoteStrategyTests.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Remote/RemoteStrategyTests.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Remote/RemoteStrategyTests.cs
index 7b99371..5c24346 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Remote/RemoteStrategyTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Remote/RemoteStrategyTests.cs
@@ -24,6 +24,7 @@
 using System;
 using System.Threading.Tasks;
 using Gremlin.Net.Driver;
+using Gremlin.Net.Driver.Exceptions;
 using Gremlin.Net.Driver.Remote;
 using Gremlin.Net.Process.Remote;
 using Gremlin.Net.Process.Traversal;
@@ -50,6 +51,17 @@ namespace Gremlin.Net.IntegrationTest.Process.Remote
 
             Assert.Equal(expectedResult, actualResult);
         }
+        
+        [Fact]
+        public void ShouldThrowOriginalExceptionWhenByteCodeIsInvalid()
+        {
+            var testBytecode = new Bytecode();
+            testBytecode.AddStep("V");
+            testBytecode.AddStep("this_step_does_not_exist", "test");
+            var testTraversal = CreateTraversalWithRemoteStrategy(testBytecode);
+
+            Assert.Throws<ResponseException>(() => testTraversal.Next());
+        }
 
         [Fact]
         public async Task ShouldSendBytecodeToGremlinServerAsynchronouslyForTraversalPromise()


[3/3] tinkerpop git commit: Merge branch 'TINKERPOP-1744' into tp32

Posted by jo...@apache.org.
Merge branch 'TINKERPOP-1744' into tp32


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6a3fc39a
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6a3fc39a
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6a3fc39a

Branch: refs/heads/tp32
Commit: 6a3fc39a912bec98707dd69d461955330627df10
Parents: 55ebe13 0728016
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Thu Aug 10 17:53:37 2017 +0200
Committer: Jorge Bay Gondra <jo...@gmail.com>
Committed: Thu Aug 10 17:53:37 2017 +0200

----------------------------------------------------------------------
 .../src/Gremlin.Net/Driver/ConnectionPool.cs    |  3 +-
 .../Remote/DriverRemoteTraversalSideEffects.cs  |  3 +-
 .../Process/Remote/RemoteStrategy.cs            |  2 +-
 gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs | 55 ++++++++++++++++++++
 .../Process/Remote/RemoteStrategyTests.cs       | 12 +++++
 5 files changed, 72 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[2/3] tinkerpop git commit: Move Utils to Gremlin.Net.Process

Posted by jo...@apache.org.
Move Utils to Gremlin.Net.Process


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/07280168
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/07280168
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/07280168

Branch: refs/heads/tp32
Commit: 07280168178a89655dead07a2435fada36eb813e
Parents: a655e26
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Wed Aug 9 15:28:21 2017 +0200
Committer: Jorge Bay Gondra <jo...@gmail.com>
Committed: Wed Aug 9 15:28:21 2017 +0200

----------------------------------------------------------------------
 .../src/Gremlin.Net/Driver/ConnectionPool.cs    |  2 +-
 .../Remote/DriverRemoteTraversalSideEffects.cs  |  2 +-
 .../Process/Remote/RemoteStrategy.cs            |  1 -
 gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs | 55 ++++++++++++++++++++
 .../src/Gremlin.Net/Structure/Utils.cs          | 55 --------------------
 5 files changed, 57 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/07280168/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPool.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPool.cs b/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPool.cs
index 98cb547..945e5e4 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPool.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPool.cs
@@ -26,7 +26,7 @@ using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
-using Gremlin.Net.Structure;
+using Gremlin.Net.Process;
 
 namespace Gremlin.Net.Driver
 {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/07280168/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversalSideEffects.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversalSideEffects.cs b/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversalSideEffects.cs
index e8df942..8f2b3e6 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversalSideEffects.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversalSideEffects.cs
@@ -25,8 +25,8 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using Gremlin.Net.Driver.Messages;
+using Gremlin.Net.Process;
 using Gremlin.Net.Process.Traversal;
-using Gremlin.Net.Structure;
 
 namespace Gremlin.Net.Driver.Remote
 {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/07280168/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs
index b914063..098a46d 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs
@@ -23,7 +23,6 @@
 
 using System.Threading.Tasks;
 using Gremlin.Net.Process.Traversal;
-using Gremlin.Net.Structure;
 
 namespace Gremlin.Net.Process.Remote
 {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/07280168/gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs
new file mode 100644
index 0000000..e1781ab
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs
@@ -0,0 +1,55 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System;
+using System.Runtime.ExceptionServices;
+using System.Threading.Tasks;
+
+namespace Gremlin.Net.Process
+{
+    /// <summary>
+    /// Contains useful methods that can be reused across the project. 
+    /// </summary>
+    internal static class Utils
+    {
+        /// <summary>
+        /// Waits the completion of the provided Task.
+        /// When an AggregateException is thrown, the inner exception is thrown.
+        /// </summary>
+        public static void WaitUnwrap(this Task task)
+        {
+            try
+            {
+                task.Wait();
+            }
+            catch (AggregateException ex)
+            {
+                if (ex.InnerExceptions.Count == 1)
+                {
+                    ExceptionDispatchInfo.Capture(ex.InnerException).Throw();   
+                }
+                throw;
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/07280168/gremlin-dotnet/src/Gremlin.Net/Structure/Utils.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/Utils.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/Utils.cs
deleted file mode 100644
index 08168ba..0000000
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/Utils.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-#region License
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#endregion
-
-using System;
-using System.Runtime.ExceptionServices;
-using System.Threading.Tasks;
-
-namespace Gremlin.Net.Structure
-{
-    /// <summary>
-    /// Contains useful methods that can be reused across the project. 
-    /// </summary>
-    internal static class Utils
-    {
-        /// <summary>
-        /// Waits the completion of the provided Task.
-        /// When an AggregateException is thrown, the inner exception is thrown.
-        /// </summary>
-        public static void WaitUnwrap(this Task task)
-        {
-            try
-            {
-                task.Wait();
-            }
-            catch (AggregateException ex)
-            {
-                if (ex.InnerExceptions.Count == 1)
-                {
-                    ExceptionDispatchInfo.Capture(ex.InnerException).Throw();   
-                }
-                throw;
-            }
-        }
-    }
-}
\ No newline at end of file