[ https://issues.apache.org/jira/browse/TINKERPOP-2128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17791623#comment-17791623 ]
ASF GitHub Bot commented on TINKERPOP-2128: ------------------------------------------- spmallette commented on code in PR #2367: URL: https://github.com/apache/tinkerpop/pull/2367#discussion_r1410644880 ########## docs/src/reference/the-traversal.asciidoc: ########## @@ -5097,6 +5097,17 @@ new transaction immediately following the `commit()` that raises the events. The may also not behave as "snapshots" at the time of their creation as they are "live" references to actual database elements. +=== ExplainStrategy Review Comment: this change seems to create a new and additional way to do explain in Java where only this new one works in non-JVM languages? there's always going to be little differences among the various languages but this one seems really fundamental. everyone knows the `explain()` and I don't think there should be another way to do it. I see the complexity of the `explain()` signature in trying to make this change - it returns `TraversalExplanation` rather than `Traversal` and is effectively a form of terminal step. I don't know if this makes this change much more elegant, but couldn't you remove the user need to know about `ExplainStrategy` if `Traversal.explain()` added it and then self-iterated to return the `TraversalExplanation`? In Java, I suppose you would self-iterate a clone so that you could still do: ``` gremlin> t = g.V().out();[] gremlin> t.explain() ==>Traversal Explanation ========================================================================================== Original Traversal [GraphStep(vertex,[]), VertexStep(OUT,vertex)] ConnectiveStrategy [D] [GraphStep(vertex,[]), VertexStep(OUT,vertex)] ... Final Traversal [TinkerGraphStep(vertex,[]), VertexStep(OUT,vertex)] gremlin> t ==>v[3] ==>v[2] ==>v[4] ==>v[5] ==>v[3] ==>v[3] ``` On the idea of a completely different approach, I can't help wondering if "explain" isn't a form of `GraphOp`, like transactions are (i.e. a special form of `Bytecode` that trigger a particular command on the server). Did you consider that? > Allow explain() to work in a remote fashion > ------------------------------------------- > > Key: TINKERPOP-2128 > URL: https://issues.apache.org/jira/browse/TINKERPOP-2128 > Project: TinkerPop > Issue Type: Improvement > Components: process > Affects Versions: 3.4.0 > Reporter: Alan Boudreault > Priority: Critical > > {{g.V().explain()}} doesn´t really work in any scenario where the traversal > is being executed remotely. the {{explain()}} applies locally in java so you > really just get this: > {code} > gremlin> g = traversal().withRemote('conf/remote-graph.properties') > ==>graphtraversalsource[emptygraph[empty], standard] > gremlin> g.V().out().explain() > ==>Traversal Explanation > ============================================================================================ > Original Traversal [GraphStep(vertex,[]), VertexStep(OUT,vertex)] > RemoteStrategy [D] > [RemoteStep(DriverServerConnection-localhost/127.0.0.1:8182 [graph=g])] > Final Traversal > [RemoteStep(DriverServerConnection-localhost/127.0.0.1:8182 [graph=g])] > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)