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 <[email protected]>
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.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---