You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Redriver (Jira)" <ji...@apache.org> on 2023/02/03 08:43:00 UTC

[jira] [Commented] (TINKERPOP-2864) GraphBinaryMessageSerializer cannot serialize DefaultComputerResult

    [ https://issues.apache.org/jira/browse/TINKERPOP-2864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17683750#comment-17683750 ] 

Redriver commented on TINKERPOP-2864:
-------------------------------------

This issue can be reproduced by adding the following testcase to 

{code}
[https://github.com/apache/tinkerpop/blob/3.5-dev/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/binary/GraphBinaryMessageSerializerV1Test.java]
{code:java}
@Test
public void shouldSerializeDefaultComputerResult() throws SerializationException {
    final ResponseMessage response = ResponseMessage.build(UUID.randomUUID())
            .code(ResponseStatusCode.SUCCESS)
            .statusMessage("Found")
            .statusAttribute("k1", 1)
            .result(new DefaultComputerResult(EmptyGraph.instance(), EmptyMemory.instance()))
            .create();

    final ByteBuf buffer = serializer.serializeResponseAsBinary(response, allocator);
    final ResponseMessage deserialized = serializer.deserializeResponse(buffer);
    assertResponseEquals(response, deserialized);
}
{code}
The error is like:

{code:java}
org.apache.tinkerpop.gremlin.driver.ser.SerializationException: java.io.IOException: Serializer for type org.apache.tinkerpop.gremlin.process.computer.util.DefaultComputerResult not found
	at org.apache.tinkerpop.gremlin.driver.ser.binary.ResponseMessageSerializer.writeValue(ResponseMessageSerializer.java:86)
	at org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1.serializeResponseAsBinary(GraphBinaryMessageSerializerV1.java:150)
	at org.apache.tinkerpop.gremlin.driver.ser.binary.GraphBinaryMessageSerializerV1Test.shouldSerializeDefaultComputerResult(GraphBinaryMessageSerializerV1Test.java:100)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: java.io.IOException: Serializer for type org.apache.tinkerpop.gremlin.process.computer.util.DefaultComputerResult not found
	at org.apache.tinkerpop.gremlin.structure.io.binary.TypeSerializerRegistry.validateInstance(TypeSerializerRegistry.java:409)
	at org.apache.tinkerpop.gremlin.structure.io.binary.TypeSerializerRegistry.getSerializer(TypeSerializerRegistry.java:378)
	at org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter.write(GraphBinaryWriter.java:90)
	at org.apache.tinkerpop.gremlin.driver.ser.binary.ResponseMessageSerializer.writeValue(ResponseMessageSerializer.java:84)
	... 29 more
{code}


> GraphBinaryMessageSerializer cannot serialize DefaultComputerResult
> -------------------------------------------------------------------
>
>                 Key: TINKERPOP-2864
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2864
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: driver
>    Affects Versions: 3.5.5
>            Reporter: Redriver
>            Priority: Major
>
> When I send the following request to gremlin-server, I got an error "{color:#1d1c1d}Serializer for type org.apache.tinkerpop.gremlin.process.computer.util.DefaultComputerResult not found{color}".
> {code:java}
> graph = GraphFactory.open('conf/fdb-psave-export.properties')
> graph.compute(SparkGraphComputer).program(CloneVertexProgram.build().create()).submit().get()
> {code}
> After investigation, I found GraphBinaryMessageSerializer cannot serialize DefaultComputerResult. The quick workaround is change the gremline to
> {code:java}
> graph = GraphFactory.open('conf/fdb-psave-export.properties')
> a= graph.compute(SparkGraphComputer).program(CloneVertexProgram.build().create()).submit().get()
> a.toString()
> {code}
> This asks the GraphBinaryMessageSerializer to serialize String instead of DefaultComputerGraph.
> I'm wondering is it possible to change the GraphBinaryMessageSerializer to automatically handle this.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)