tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [36/50] incubator-tinkerpop git commit: Throw a server error if someone sends a locked traversal.
Date Thu, 17 Mar 2016 22:44:09 GMT
Throw a server error if someone sends a locked traversal.


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

Branch: refs/heads/TINKERPOP-575
Commit: 77fad20e827ccacc5ab394e8fb3c5df743ffd949
Parents: e5ad5f1
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Wed Mar 16 15:09:08 2016 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Thu Mar 17 17:01:35 2016 -0400

----------------------------------------------------------------------
 .../server/op/traversal/TraversalOpProcessor.java        | 11 +++++++----
 .../gremlin/driver/remote/RemoteGraphProvider.java       |  1 -
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/77fad20e/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
index a67de1d..ee81ade 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
@@ -129,14 +129,17 @@ public class TraversalOpProcessor extends AbstractOpProcessor {
         final Traversal traversal;
         try {
             traversal = (Traversal) Serializer.deserializeObject(serializedTraversal);
-
-            // todo: isLocked() server error
-            assert !traversal.asAdmin().isLocked();
         } catch (Exception ex) {
             throw new OpProcessorException("Could not deserialize the Traversal instance",
-                    ResponseMessage.build(msg).code(ResponseStatusCode.SERVER_ERROR_SERIALIZATION).statusMessage(ex.getMessage()).create());
+                    ResponseMessage.build(msg).code(ResponseStatusCode.SERVER_ERROR_SERIALIZATION)
+                            .statusMessage(ex.getMessage()).create());
         }
 
+        if (!traversal.asAdmin().isLocked())
+            throw new OpProcessorException("Locked Traversals cannot be processed by the
server",
+                    ResponseMessage.build(msg).code(ResponseStatusCode.SERVER_ERROR_SERIALIZATION)
+                            .statusMessage("Locked Traversals cannot be processed by the
server").create());
+
         try {
             final ChannelHandlerContext ctx = context.getChannelHandlerContext();
             final GraphManager graphManager = context.getGraphManager();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/77fad20e/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java
index abba9e9..848c510 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java
@@ -28,7 +28,6 @@ import org.apache.tinkerpop.gremlin.server.GremlinServer;
 import org.apache.tinkerpop.gremlin.server.ServerTestHelper;
 import org.apache.tinkerpop.gremlin.server.Settings;
 import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
 
 import java.io.InputStream;
 import java.util.HashMap;


Mime
View raw message