babeloff / janusgraph-docker-old

JanusGraph Docker images
Other
0 stars 0 forks source link

Serialize TinkerGraph from Service to Client #1

Open phreed opened 3 years ago

phreed commented 3 years ago

Given... conf/remote-subgraphs.yaml

hosts:
- janusgraph

port: 8182

serializer:
  className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
  config:
    ioRegistries:
    - org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry
    - org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0

Requests such as the following currently fail due to the TinkerIoRegistryV3d0 not being available on the server for serialization of subgraphs.

gremlin> :remote connect tinkerpop.server conf/remote-subgraphs.yaml
==>Configured janusgraph/172.17.0.2:8182
gremlin> :> g.addV('fred').as('f`).addVnext(`barney').as('b').addE('friends').from('f').to('b').iterate()
gremlin> :> g.E().subgraph('a').cap('a').next()
==>tinkergraph[vertices:2 edges:1]
phreed commented 3 years ago

The fix is to update the gremlin-server.yaml with

serializers:
  - className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
    config:
      ioRegistries:
        - org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry
        - org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0
  - className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0