Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1230

Serialising lambdas for RemoteGraph

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 3.1.1-incubating
    • Fix Version/s: 3.2.2
    • Component/s: driver, server
    • Labels:
      None

      Description

      I just made an attempt to serialise lambdas and send them via the RemoteGraph. I didn't quite get there, but wanted to share my findings:

      • sending a normal predicate doesn't work (this is a Scala REPL but it should be pretty easy to convert this to java/groovy)
        val g = RemoteGraph.open("conf/remote-graph.properties").traversal()
        val pred1 = new java.util.function.Predicate[Traverser[Vertex]] { def test(v: Traverser[Vertex]) = true }

        g.V().filter(pred1).toList
        // java.lang.RuntimeException: java.io.NotSerializableException: $anon$1
        // on server: nothing

      • simply adding Serializable let's us send it over the wire, but the server doesn't deserialise it
        val pred2 = new java.util.function.Predicate[Traverser[Vertex]] with Serializable { def test(v: Traverser[Vertex]) = true }

        g.V().filter(pred2).toList
        // on server: [WARN] OpExecutorHandler - Could not deserialize the Traversal instance
        org.apache.tinkerpop.gremlin.server.op.OpProcessorException: Could not deserialize the Traversal instance
        at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.iterateOp(TraversalOpProcessor.java:135)
        at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:68)
        // on client: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: $anon$1

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                okram Marko A. Rodriguez
                Reporter:
                mpollmeier Michael Pollmeier
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: