[
https://issues.apache.org/jira/browse/TINKERPOP3-732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14649519#comment-14649519
]
stephen mallette commented on TINKERPOP3-732:
---------------------------------------------
I guess the TP2 format is as good as any. It worked there and I can't recall
any complaints. As you wanted this for GA, I'll assume it's important and we
can try to drop it into 3.0.1. It's low-risk for the most part and doesn't
introduce anything breaking that i can think of. If you move forward with
this, please do your work against the {{tp30}} branch as we'll merge into there
for 3.0.1.
To implement, you would add a {{TreeJacksonSerializer}} to
{{GraphSONSerializers}}. You'll see other ones there if you look at the class
and can model after those. Then once you have that, you need to register your
serializer to {{Tree}}:
https://github.com/apache/incubator-tinkerpop/blob/53113298e1802fd4d14b5fb13e101d81b18fa38d/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java#L54-L63
Then you need unit tests - you would add them here:
https://github.com/apache/incubator-tinkerpop/blob/53113298e1802fd4d14b5fb13e101d81b18fa38d/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
Whatever tests you write for GraphSON, please do the same for Gryo so that we
keep the tests in synch. Gryo should already serialize {{Tree}} without issue
and won't have any funky structure to it - you should be able to write a
{{Tree}} and read back the a {{Tree}}. Consider tests that serialize mixed
values returned into the {{Tree}} as we don't always have just vertices:
{code}
gremlin> g.V(1).out().properties('name').tree().next()
==>v[1]={v[2]={vp[name->vadas]={}}, v[3]={vp[name->lop]={}},
v[4]={vp[name->josh]={}}}
{code}
Finally, if you want to be a super-hero and validate with greater certainty
that {{Tree}} will work with Gremlin Server (which is what you're gunning for i
believe) you can write tests for the higher-level serializers here that gremlin
driver/server use:
https://github.com/apache/incubator-tinkerpop/tree/53113298e1802fd4d14b5fb13e101d81b18fa38d/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser
Doing all that would make a nice PR - still want to do it? :)
> gremlin-server GraphSON serializer issue with tree()
> ----------------------------------------------------
>
> Key: TINKERPOP3-732
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-732
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: io
> Affects Versions: 3.0.0-incubating
> Reporter: Dylan Millikin
> Assignee: stephen mallette
>
> When using the {{tree()}} step with a GraphSON serializer the server hangs
> (though I've seen some form of serialization errors in more complex scenarios
> over titan).
> The following works fine in the console but fails using the graphSON
> serializer:
> {code:java}
> g.V(1).repeat(out()).until(out().count().is(0)).tree() // fails with .next()
> as well
> {code}
> The following works without a problem though:
> {code:java}
> g.V(1).repeat(out()).until(out().count().is(0))
> {code}
> Here's the configuration file I use for these tests:
> {code}
> host: localhost
> port: 8182
> threadPoolWorker: 1
> gremlinPool: 8
> scriptEvaluationTimeout: 30000
> serializedResponseTimeout: 30000
> channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
> graphs: {
> graph: conf/tinkergraph-empty.properties
> }
> plugins:
> - tinkerpop.tinkergraph
> scriptEngines: {
> gremlin-groovy: {
> imports: [java.lang.Math],
> staticImports: [java.lang.Math.PI],
> scripts: [scripts/generate-classic.groovy]}}
> serializers:
> - { className:
> org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 }
> - { className:
> org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: {
> serializeResultToString: true }}
> - { className:
> org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0 }
> - { className:
> org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 }
> processors:
> - { className:
> org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: {
> sessionTimeout: 28800000 }}
> metrics: {
> consoleReporter: {enabled: true, interval: 180000},
> csvReporter: {enabled: true, interval: 180000, fileName:
> /tmp/gremlin-server-metrics.csv},
> jmxReporter: {enabled: true},
> slf4jReporter: {enabled: true, interval: 180000},
> gangliaReporter: {enabled: false, interval: 180000, addressingMode:
> MULTICAST},
> graphiteReporter: {enabled: false, interval: 180000}
> }
> threadPoolBoss: 1
> maxInitialLineLength: 4096
> maxHeaderSize: 8192
> maxChunkSize: 8192
> maxContentLength: 65536
> maxAccumulationBufferComponents: 1024
> resultIterationBatchSize: 64
> writeBufferHighWaterMark: 32768
> writeBufferHighWaterMark: 65536
> ssl: {
> enabled: false}
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)