[
https://issues.apache.org/jira/browse/TINKERPOP-2291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16916793#comment-16916793
]
ASF GitHub Bot commented on TINKERPOP-2291:
-------------------------------------------
spmallette commented on pull request #1183: TINKERPOP-2291 Added GraphSON
support for deserialization of TraversalExplanation
URL: https://github.com/apache/tinkerpop/pull/1183
https://issues.apache.org/jira/browse/TINKERPOP-2291
Added the notion of `ImmutableExplanation` which allows the deserialization
to occur. As an immutable object the recalculation of the
`TraversalExplanation` does not need to occur from the raw data. In fact, if it
did it would be "wrong" as it would recalculate on the client rather than the
server and server side strategies may not be applied. That said, the design
choices here in the class hierarchy are a bit odd in that
`ImmutableExplanatio`n should really extend `AbstractExplanation`, but to avoid
breaking changes in derser in gryo/graphson it seemed best to go with the
slightly less optimal approach. Perhaps a future release branch were breaking
changes are allowed can rectify this.
Builds with `mvn clean install && mvn verify -pl gremlin-server
-DskipIntegrationTests=false`
VOTE +1
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> TraversalExplanation deserialization in GraphSON
> ------------------------------------------------
>
> Key: TINKERPOP-2291
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2291
> Project: TinkerPop
> Issue Type: Bug
> Components: io
> Affects Versions: 3.3.8
> Reporter: stephen mallette
> Assignee: stephen mallette
> Priority: Major
>
> We currently coerce {{TraversalExplanation}} to {{Map}} which works well for
> GLVs but doesn't work so well for Java itself where GraphSON deserialization
> requires a symmetrical derser operation.
> Leads to errors like:
> {code}
> org.apache.tinkerpop.shaded.jackson.databind.JsonMappingException: Could not
> deserialize the JSON value as required. Nested exception:
> org.apache.tinkerpop.shaded.jackson.databind.JsonMappingException: Could not
> deserialize the JSON value as required. Nested exception:
> org.apache.tinkerpop.shaded.jackson.databind.exc.UnrecognizedPropertyException:
> Unrecognized field "@type" (class
> org.apache.tinkerpop.gremlin.process.traversal.util.TraversalExplanation),
> not marked as ignorable (one known property: "strategyTraversals"])
> at [Source:
> (byte[])"{"requestId":"0bcc54dc-87a0-408b-abe0-35678333827e","status":{"message":"","code":200,"attributes":{"@type":"g:Map","@value":["host","/127.0.0.1:50299"]}},"result":{"data":{"@type":"g:List","@value":[{"@type":"g:TraversalExplanation","@value":{"@type":"g:Map","@value":["original",{"@type":"g:List","@value":["GraphStep(vertex,[])"]},"intermediate",{"@type":"g:List","@value":[{"@type":"g:Map","@value":["traversal",{"@type":"g:List","@value":["GraphStep(vertex,[])"]},"strategy","ConnectiveStrategy""[truncated
> 2707 bytes]; line: 1, column: 254] (through reference chain:
> org.apache.tinkerpop.gremlin.process.traversal.util.TraversalExplanation["@type"])
> at [Source:
> (byte[])"{"requestId":"0bcc54dc-87a0-408b-abe0-35678333827e","status":{"message":"","code":200,"attributes":{"@type":"g:Map","@value":["host","/127.0.0.1:50299"]}},"result":{"data":{"@type":"g:List","@value":[{"@type":"g:TraversalExplanation","@value":{"@type":"g:Map","@value":["original",{"@type":"g:List","@value":["GraphStep(vertex,[])"]},"intermediate",{"@type":"g:List","@value":[{"@type":"g:Map","@value":["traversal",{"@type":"g:List","@value":["GraphStep(vertex,[])"]},"strategy","ConnectiveStrategy""[truncated
> 2707 bytes]; line: 1, column: 253]
> at [Source:
> (byte[])"{"requestId":"0bcc54dc-87a0-408b-abe0-35678333827e","status":{"message":"","code":200,"attributes":{"@type":"g:Map","@value":["host","/127.0.0.1:50299"]}},"result":{"data":{"@type":"g:List","@value":[{"@type":"g:TraversalExplanation","@value":{"@type":"g:Map","@value":["original",{"@type":"g:List","@value":["GraphStep(vertex,[])"]},"intermediate",{"@type":"g:List","@value":[{"@type":"g:Map","@value":["traversal",{"@type":"g:List","@value":["GraphStep(vertex,[])"]},"strategy","ConnectiveStrategy""[truncated
> 2707 bytes]; line: 1, column: 253] (through reference chain:
> java.util.LinkedHashMap["result"]->java.util.LinkedHashMap["data"])
> {code}
--
This message was sent by Atlassian Jira
(v8.3.2#803003)