You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/02/24 21:00:20 UTC

[jira] [Commented] (TINKERPOP-1147) Add serialization for TraversalExplanation

    [ https://issues.apache.org/jira/browse/TINKERPOP-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15163704#comment-15163704 ] 

ASF GitHub Bot commented on TINKERPOP-1147:
-------------------------------------------

GitHub user spmallette opened a pull request:

    https://github.com/apache/incubator-tinkerpop/pull/241

    TINKERPOP-1147 Added serialization support for TraversalExplanation

    https://issues.apache.org/jira/browse/TINKERPOP-1147
    
    Covers both gryo and graphson. Gryo uses standard Java serialization as the object graph is mighty deep and building a native kryo serializer would have been a lot. GraphSON serializes to a JSON format which pretty much just allows you to get the data required to build what would have come from TraversalExplanation.toString().  It's mostly just for display purposes. Basically looks like this:
    
    ```js
    {
    	"original": ["GraphStep([],vertex)", "VertexStep(OUT,edge)", "EdgeVertexStep(IN)", "VertexStep(OUT,vertex)"],
    	"intermediate": [{
    		"traversal": ["GraphStep([],vertex)", "VertexStep(OUT,edge)", "EdgeVertexStep(IN)", "VertexStep(OUT,vertex)"],
    		"strategy": "ConnectiveStrategy",
    		"category": "DecorationStrategy"
    	}, {
    		"traversal": ["GraphStep([],vertex)", "VertexStep(OUT,edge)", "EdgeVertexStep(IN)", "VertexStep(OUT,vertex)"],
    		"strategy": "IdentityRemovalStrategy",
    		"category": "OptimizationStrategy"
    	}, {
    		"traversal": ["GraphStep([],vertex)", "VertexStep(OUT,edge)", "EdgeVertexStep(IN)", "VertexStep(OUT,vertex)"],
    		"strategy": "FilterRankingStrategy",
    		"category": "OptimizationStrategy"
    	}, {
    		"traversal": ["GraphStep([],vertex)", "VertexStep(OUT,vertex)", "VertexStep(OUT,vertex)"],
    		"strategy": "IncidentToAdjacentStrategy",
    		"category": "OptimizationStrategy"
    	}, {
    		"traversal": ["GraphStep([],vertex)", "VertexStep(OUT,vertex)", "VertexStep(OUT,vertex)"],
    		"strategy": "AdjacentToIncidentStrategy",
    		"category": "OptimizationStrategy"
    	}, {
    		"traversal": ["GraphStep([],vertex)", "VertexStep(OUT,vertex)", "VertexStep(OUT,vertex)"],
    		"strategy": "MatchPredicateStrategy",
    		"category": "OptimizationStrategy"
    	}, {
    		"traversal": ["GraphStep([],vertex)", "VertexStep(OUT,vertex)", "VertexStep(OUT,vertex)"],
    		"strategy": "RangeByIsCountStrategy",
    		"category": "OptimizationStrategy"
    	}, {
    		"traversal": ["TinkerGraphStep([],vertex)", "VertexStep(OUT,vertex)", "VertexStep(OUT,vertex)"],
    		"strategy": "TinkerGraphStepStrategy",
    		"category": "ProviderOptimizationStrategy"
    	}, {
    		"traversal": ["TinkerGraphStep([],vertex)", "VertexStep(OUT,vertex)", "VertexStep(OUT,vertex)"],
    		"strategy": "ProfileStrategy",
    		"category": "FinalizationStrategy"
    	}, {
    		"traversal": ["TinkerGraphStep([],vertex)", "VertexStep(OUT,vertex)", "VertexStep(OUT,vertex)"],
    		"strategy": "EngineDependentStrategy",
    		"category": "FinalizationStrategy"
    	}, {
    		"traversal": ["TinkerGraphStep([],vertex)", "VertexStep(OUT,vertex)", "VertexStep(OUT,vertex)"],
    		"strategy": "ComputerVerificationStrategy",
    		"category": "VerificationStrategy"
    	}, {
    		"traversal": ["TinkerGraphStep([],vertex)", "VertexStep(OUT,vertex)", "VertexStep(OUT,vertex)"],
    		"strategy": "StandardVerificationStrategy",
    		"category": "VerificationStrategy"
    	}],
    	"final": ["TinkerGraphStep([],vertex)", "VertexStep(OUT,vertex)", "VertexStep(OUT,vertex)"]
    }
    ```
    
    VOTE +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-tinkerpop TINKERPOP-1147

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-tinkerpop/pull/241.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #241
    
----
commit c2a5da2c72c7eb268883825c8cda18decb9b804a
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-02-24T19:55:11Z

    Added serialization support for TraversalExplanation.
    
    Covers both gryo and graphson. Gryo uses standard Java serialization as the object graph is mighty deep and building a native kryo serializer would have been a lot. GraphSON serializes to a JSON format which pretty much just allows you to get the data required to build what would have come from TraversalExplanation.toString().  It's mostly just for display purposes.

----


> Add serialization for TraversalExplanation
> ------------------------------------------
>
>                 Key: TINKERPOP-1147
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1147
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: io
>    Affects Versions: 3.1.1-incubating
>            Reporter: Bob Briody
>            Assignee: stephen mallette
>             Fix For: 3.1.2-incubating
>
>
> When executing a traversal like the one below remotely, serialization fails
> {code}
> g.V().explain()
> {code}
> Error:
> {code}
> org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Error during serialization: Class is not registered: org.apache.tinkerpop.gremlin.process.traversal.util.TraversalExplanation
> {code}
> Need to add serialization handling for TraversalExplanation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)