Volker
Volker
ATApache TinkerPop
Created by Volker on 3/17/2023 in #questions
Preventing Janusgraph crash on timeout
According to this: https://stackoverflow.com/questions/61985018/janusgraph-image-stop-responding-after-query-timeout-how-to-prevent-it and my own findings, Janusgraph hard crashes on gremlin timeouts because of the default used berkeley storage handler. To circumvent this, I'm trying to end my query before the time limit is reached, which seems to work pretty well. But how can I access the executionTimeout value from a Strategy or Step? Afaik it's only available in the Context, which doesn't get passed down to Strategy and Step. Greetings Volker
17 replies
ATApache TinkerPop
Created by Volker on 2/3/2023 in #questions
Serialize custom sack
When trying to return the value of a custom sack object with .sack(), following error is thrown:
2023-02-03 12:40:20 java.lang.IllegalArgumentException: Class is not registered: org.apache.tinkerpop.gremlin.server.jsr223.ScriptData
2023-02-03 12:40:20 Note: To register this class use: kryo.register(org.apache.tinkerpop.gremlin.server.jsr223.ScriptData.class);
2023-02-03 12:40:20 at org.apache.tinkerpop.shaded.kryo.Kryo.getRegistration(Kryo.java:488)
2023-02-03 12:40:20 at org.apache.tinkerpop.gremlin.structure.io.gryo.AbstractGryoClassResolver.writeClass(AbstractGryoClassResolver.java:110)
2023-02-03 12:40:20 at org.apache.tinkerpop.shaded.kryo.Kryo.writeClass(Kryo.java:517)
2023-02-03 12:40:20 at org.apache.tinkerpop.shaded.kryo.Kryo.writeClassAndObject(Kryo.java:622)
2023-02-03 12:40:20 at org.apache.tinkerpop.shaded.kryo.serializers.CollectionSerializer.write(CollectionSerializer.java:100)
2023-02-03 12:40:20 at org.apache.tinkerpop.shaded.kryo.serializers.CollectionSerializer.write(CollectionSerializer.java:40)
...
2023-02-03 12:40:20 java.lang.IllegalArgumentException: Class is not registered: org.apache.tinkerpop.gremlin.server.jsr223.ScriptData
2023-02-03 12:40:20 Note: To register this class use: kryo.register(org.apache.tinkerpop.gremlin.server.jsr223.ScriptData.class);
2023-02-03 12:40:20 at org.apache.tinkerpop.shaded.kryo.Kryo.getRegistration(Kryo.java:488)
2023-02-03 12:40:20 at org.apache.tinkerpop.gremlin.structure.io.gryo.AbstractGryoClassResolver.writeClass(AbstractGryoClassResolver.java:110)
2023-02-03 12:40:20 at org.apache.tinkerpop.shaded.kryo.Kryo.writeClass(Kryo.java:517)
2023-02-03 12:40:20 at org.apache.tinkerpop.shaded.kryo.Kryo.writeClassAndObject(Kryo.java:622)
2023-02-03 12:40:20 at org.apache.tinkerpop.shaded.kryo.serializers.CollectionSerializer.write(CollectionSerializer.java:100)
2023-02-03 12:40:20 at org.apache.tinkerpop.shaded.kryo.serializers.CollectionSerializer.write(CollectionSerializer.java:40)
...
The solution seems to be simple: To register this class use: kryo.register, but I can't find any documentation on how to do this for over a day now. Can you please provide me a hint in the right direction?
3 replies
ATApache TinkerPop
Created by Volker on 1/24/2023 in #questions
Gremlin server plugin for running additional function on each vertex edge
Dear TinkerPop team, I'm currently trying to wrap my head around a specific problem I've been trying to solve for a few days. Basic overview: Vertices and edges can have a code field, e.g.: Vertex: a = True Edge: a == True While "travelling" over vertices, a custom script engine runs and saves the resulting variables with name and value into the current gremlin sack. When an edge is reached, the script engine evaluates the expression and tells gremlin to continue or break the current path. The script engine is written in Rust and works, the java bindings are not a problem either. What I can't figure out and would really appreciate your help with, is the gremlin part of this project. As far as I know, I have to create a gremlin server plugin like GremlinServerGremlinPlugin.java in the tinkerpop github repository, but if and how I can inject this custom functionality, is beyond me. Any hint would be highly appreciated. Thanks Volker
73 replies