Re: Connecting to server from java: can't lock berkeleyje
hadoopmarc@...
The stacktrace is not very helpful, unfortunately, but that is not your doing. The original example does not use an "ats" variable but instantiates g with a oneliner, but it hard to see why this could make a difference. Most likely, the code has trouble finding the conf/remote-objects.yaml file, referenced in the conf/remote-graph.properties file.
As an alternative to fiddling with your current code, you could take a look at: https://github.com/JanusGraph/janusgraph/tree/v0.6.2/janusgraph-examples/example-remotegraph Best wishes, Marc
|
|
Re: Connecting to server from java: can't lock berkeleyje
queshaw
D'oh... So, after that, I get a NullPointerException: AnonymousTraversalSource<GraphTraversalSource> ats = traversal(); // not null if (new File(props).exists()) // path to conf/remote-graph.properties g = ats.withRemote(props); java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException at org.apache.tinkerpop.gremlin.process.remote.RemoteConnection.from(RemoteConnection.java:73) at org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource.withRemote(AnonymousTraversalSource.java:76) at org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource.withRemote(AnonymousTraversalSource.java:66) at lnf.graph.Queries.go(Queries.java:52) at lnf.graph.Queries.main(Queries.java:41) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.apache.tinkerpop.gremlin.process.remote.RemoteConnection.from(RemoteConnection.java:71) ... 4 more Caused by: java.lang.IllegalStateException: java.lang.NullPointerException at org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection.<init>(DriverRemoteConnection.java:84) ... 9 more Caused by: java.lang.NullPointerException at org.apache.tinkerpop.gremlin.driver.Cluster.open(Cluster.java:255) at org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection.<init>(DriverRemoteConnection.java:80) ... 9 more The server is running and I can connect from gremlin shell.
On Sunday, September 11, 2022 5:03 AM, hadoopmarc@... wrote:
|
|
Re: Janusgraph-full-0.6.1: how to fix "WARNING: Critical severity vulnerabilities were found with Log4j!"
Yingjie Li
Hello Marc, Yes. Now it works! Thanks Yingjie
On Fri, Sep 9, 2022 at 4:08 PM <hadoopmarc@...> wrote: Hi Yingjie,
|
|
Re: Connecting to server from java: can't lock berkeleyje
hadoopmarc@...
You can take a look at:
https://docs.janusgraph.org/interactions/connecting/java/ Apparently, you used JanusGraphFactory, which opens an embedded JanusGraph instance in the client. If you want to client to connect to a JanusGraph serrver, you use need the g = traversal().withRemote() syntax as shown in the link above. Best wishes, Marc
|
|
Re: Connecting to server from java: can't lock berkeleyje
queshaw
I should probably add I intend to use import static org.janusgraph.core.attribute.Text.* for textContains etc.
On Saturday, September 10, 2022 8:50 AM, queshaw <queshaw@...> wrote:
|
|
Connecting to server from java: can't lock berkeleyje
queshaw
I'm trying to connect to janusgraph server from java. If I follow the instructions in the documentation, using this in gradle: implementation 'org.janusgraph:janusgraph-driver:0.6.2' implementation 'org.apache.tinkerpop:gremlin-driver:3.5.3' JanusGraph and JanusGraphFactory can't be found. If I add: implementation 'org.janusgraph:janusgraph-core:0.6.2' and I use conf/remote-graph.properties, I get an error message that root.storage.backend needs to be defined. I don't find that property, but if I add: storage.backend=berkeleyje then I get Could not find implementation class: org.janusgraph.diskstorage.berkeleyje.BerkeleyJEStoreManager If I add: implementation 'org.janusgraph:janusgraph-berkeleyje:0.6.2' then I get: Please supply configuration parameter "storage.directory" or both "storage.root" and "graph.graphname". If I add: storage.directory=/somewhere/graph/berkeleyje then I get: /somewhere/graph/berkeleyje The environment cannot be locked for single writer access. ENV_LOCKED: The je.lck file could not be locked. Environment is invalid and must be closed. I think that is because the server is running and the file is locked. How can I connect to a running server remotely from java, if I'm using berkeleyje? I've been able to connect to the server to run queries from python and from gremlin shell. Thanks.
|
|
Re: Janusgraph-full-0.6.1: how to fix "WARNING: Critical severity vulnerabilities were found with Log4j!"
hadoopmarc@...
Hi Yingjie,
My suggestion was incomplete. In addition to removing the log4j-1.2.17.jar file from the lib folder, you have to remove the slf4j-log4j12-1.7.30.jar file as well. Otherwise, JanusGraph server starts looking for the log4j jar and crashes, as you found out. Best wishes, Marc
|
|
Re: Janusgraph-full-0.6.1: how to fix "WARNING: Critical severity vulnerabilities were found with Log4j!"
Yingjie Li
On Sat, Aug 20, 2022 at 09:28 AM, <hadoopmarc@...> wrote:
The JanusGraph and TinkerPop code only explicitly depend on slfj4j, so you can choose the logging implementation. you want You can simply remove the log4j-1.2.17.jar from the lib folder of the janusgraph binary distribution or exclude it in the pom.xml of any project depending on janusgraph.Hello Marc, If I remove log4j-1.2.17.jar from the lib directory of janusgraph distribution, say janusgraph-full-0.6.2/lib,then the janusgraph server can not be started. Below is the error message, and there is no janusgraph.log writen out. Am I missing anything? Thanks, Yingjie ...... Forking Cassandra...
Running `nodetool statusbinary`.... OK (returned exit status 0 and printed string "running").
Forking Elasticsearch...
Connecting to Elasticsearch (127.0.0.1:9200)....... OK (connected to 127.0.0.1:9200).
Forking JanusGraph-Server...
Connecting to JanusGraph-Server (127.0.0.1:8182)............................. timeout exceeded (60 seconds): could not connect to 127.0.0.1:8182
See janusgraph install directory/bin/../logs/janusgraph.log for JanusGraph-Server log output.
|
|
Re: Cannot pass list of maps to withSideEffect
Florian Hockmann
Oh wow, I assumed that Gremlin.Net would throw if it has no GraphSON serializer for a given type but turns out that it just provides the object unchanged to the JsonSerializer from System.Text.Json which results in a JSON serialization that is not strongly typed like it should be with GraphSON. This is the result for your example:
{"@type":"g:List","@value":[{"X":1,"Y":2},{"X":3,"Y":4}]}
I’m not sure if this is a bug or a feature to be honest, but this sentence from the GraphSON 3 spec at least sounds like this shouldn’t be possible:
“GraphSON 3.0 does not have an option to be typeless. Types are always embedded except for strings and boolean values which are inferred from JSON types.”
https://tinkerpop.apache.org/docs/current/dev/io/#graphson-3d0
I created another issue for this: https://issues.apache.org/jira/browse/TINKERPOP-2788
Von: janusgraph-users@... <janusgraph-users@...> Im Auftrag von bill.poole via lists.lfaidata.foundation
Thanks Florian. I’ve created the issue with TinkerPop here.
You said that using my own class XXX cannot work, but strangely it seems to with the following code showing the injected array of XXX objects being successfully returned from the server:
var xxx = new[] { new XXX { X = 1, Y = 2 }, new XXX { X = 3, Y = 4 } };
var result = (List<object>)await g.Inject<object>(xxx).Promise(t => t.ToList()); foreach (var x in result) { foreach (var pair in (Dictionary<object, object>)x) { Console.WriteLine($"{pair.Key}: {pair.Value}"); } }
… which displays:
X: 1 Y: 2 X: 3 Y: 4
From: janusgraph-users@... <janusgraph-users@...> On Behalf Of Florian Hockmann
Sent: Wednesday, 31 August 2022 10:11 PM To: janusgraph-users@... Subject: Re: [janusgraph-users] Cannot pass list of maps to withSideEffect
This sounds like a bug in Gremlin.Net to me, especially since it’s working with the Inject() step. Could you please create an issue with the TinkerPop (to which Gremlin.Net belongs) project here: https://issues.apache.org/jira/browse/TINKERPOP/ ?
Your second example with your own class XXX however cannot work as Gremlin.Net and Gremlin Server / JanusGraph Server cannot know how to serialize / deserialize this type. You would need to write your own serializer and deserializer for this type to make it work.
Von: janusgraph-users@... <janusgraph-users@...> Im Auftrag von bill.poole via lists.lfaidata.foundation
Hi All – I’m trying to use the withSideEffect() configuration to add a list of maps to GraphTraversalSource like is done in the Long Traversals recipe and the server throws an exception – “Could not deserialize the Traversal instance java.lang.IllegalStateException: Could not locate method: GraphTraversalSource.withSideEffect(String, LinkedHashMap, LinkedHashMap)”
The .NET code that reproduces the error:
var server = new GremlinServer("localhost", port: 8182); var client = JanusGraphClientBuilder.BuildClientForServer(server).Create(); using var connection = new DriverRemoteConnection(client); var g = AnonymousTraversalSource.Traversal().WithRemote(connection);
var xxx = new[] { new Dictionary<object, object> { { "x", 1 }, { "y", 2 } }, new Dictionary<object, object> { { "x", 3 }, { "y", 4 } } };
await g.WithSideEffect("xxx", xxx).V().Promise(t => t.ToList());
The same result is produced using an array of strongly typed objects:
public class XXX { public int X { get; init; } public int Y { get; init; } }
var server = new GremlinServer("localhost", port: 8182); var client = JanusGraphClientBuilder.BuildClientForServer(server).Create(); using var connection = new DriverRemoteConnection(client); var g = AnonymousTraversalSource.Traversal().WithRemote(connection);
var xxx = new[] { new XXX { X = 1, Y = 2 }, new XXX { X = 3, Y = 4 } };
await g.WithSideEffect("xxx", xxx).V().Promise(t => t.ToList());
However, the “inject” step works fine passing an array of maps:
await g.Inject<object>(xxx).Promise(t => t.ToList());
Invoking “withSideEffect” produces the following error on the server:
ERROR org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor - Could not deserialize the Traversal instance java.lang.IllegalStateException: Could not locate method: GraphTraversalSource.withSideEffect(String, LinkedHashMap, LinkedHashMap) at org.apache.tinkerpop.gremlin.jsr223.JavaTranslator.invokeMethod(JavaTranslator.java:300) at org.apache.tinkerpop.gremlin.jsr223.JavaTranslator.translate(JavaTranslator.java:85) at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.iterateBytecodeTraversal(TraversalOpProcessor.java:181) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:67) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:43) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:82) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.lang.Thread.run(Thread.java:750) 31637 [gremlin-server-worker-1] WARN org.apache.tinkerpop.gremlin.server.handler.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.iterateBytecodeTraversal(TraversalOpProcessor.java:195) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:67) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:43) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:82) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.lang.Thread.run(Thread.java:750)
Is this a bug, or am I doing something wrong?
- Bill
|
|
Re: Cannot pass list of maps to withSideEffect
bill.poole@...
Thanks Florian. I’ve created the issue with TinkerPop here.
You said that using my own class XXX cannot work, but strangely it seems to with the following code showing the injected array of XXX objects being successfully returned from the server:
var xxx = new[] { new XXX { X = 1, Y = 2 }, new XXX { X = 3, Y = 4 } };
var result = (List<object>)await g.Inject<object>(xxx).Promise(t => t.ToList()); foreach (var x in result) { foreach (var pair in (Dictionary<object, object>)x) { Console.WriteLine($"{pair.Key}: {pair.Value}"); } }
… which displays:
X: 1 Y: 2 X: 3 Y: 4
From: janusgraph-users@... <janusgraph-users@...> On Behalf Of Florian Hockmann
Sent: Wednesday, 31 August 2022 10:11 PM To: janusgraph-users@... Subject: Re: [janusgraph-users] Cannot pass list of maps to withSideEffect
This sounds like a bug in Gremlin.Net to me, especially since it’s working with the Inject() step. Could you please create an issue with the TinkerPop (to which Gremlin.Net belongs) project here: https://issues.apache.org/jira/browse/TINKERPOP/ ?
Your second example with your own class XXX however cannot work as Gremlin.Net and Gremlin Server / JanusGraph Server cannot know how to serialize / deserialize this type. You would need to write your own serializer and deserializer for this type to make it work.
Von: janusgraph-users@... <janusgraph-users@...> Im Auftrag von bill.poole via lists.lfaidata.foundation
Hi All – I’m trying to use the withSideEffect() configuration to add a list of maps to GraphTraversalSource like is done in the Long Traversals recipe and the server throws an exception – “Could not deserialize the Traversal instance java.lang.IllegalStateException: Could not locate method: GraphTraversalSource.withSideEffect(String, LinkedHashMap, LinkedHashMap)”
The .NET code that reproduces the error:
var server = new GremlinServer("localhost", port: 8182); var client = JanusGraphClientBuilder.BuildClientForServer(server).Create(); using var connection = new DriverRemoteConnection(client); var g = AnonymousTraversalSource.Traversal().WithRemote(connection);
var xxx = new[] { new Dictionary<object, object> { { "x", 1 }, { "y", 2 } }, new Dictionary<object, object> { { "x", 3 }, { "y", 4 } } };
await g.WithSideEffect("xxx", xxx).V().Promise(t => t.ToList());
The same result is produced using an array of strongly typed objects:
public class XXX { public int X { get; init; } public int Y { get; init; } }
var server = new GremlinServer("localhost", port: 8182); var client = JanusGraphClientBuilder.BuildClientForServer(server).Create(); using var connection = new DriverRemoteConnection(client); var g = AnonymousTraversalSource.Traversal().WithRemote(connection);
var xxx = new[] { new XXX { X = 1, Y = 2 }, new XXX { X = 3, Y = 4 } };
await g.WithSideEffect("xxx", xxx).V().Promise(t => t.ToList());
However, the “inject” step works fine passing an array of maps:
await g.Inject<object>(xxx).Promise(t => t.ToList());
Invoking “withSideEffect” produces the following error on the server:
ERROR org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor - Could not deserialize the Traversal instance java.lang.IllegalStateException: Could not locate method: GraphTraversalSource.withSideEffect(String, LinkedHashMap, LinkedHashMap) at org.apache.tinkerpop.gremlin.jsr223.JavaTranslator.invokeMethod(JavaTranslator.java:300) at org.apache.tinkerpop.gremlin.jsr223.JavaTranslator.translate(JavaTranslator.java:85) at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.iterateBytecodeTraversal(TraversalOpProcessor.java:181) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:67) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:43) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:82) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.lang.Thread.run(Thread.java:750) 31637 [gremlin-server-worker-1] WARN org.apache.tinkerpop.gremlin.server.handler.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.iterateBytecodeTraversal(TraversalOpProcessor.java:195) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:67) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:43) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:82) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.lang.Thread.run(Thread.java:750)
Is this a bug, or am I doing something wrong?
- Bill
|
|
Re: Cannot pass list of maps to withSideEffect
Florian Hockmann
This sounds like a bug in Gremlin.Net to me, especially since it’s working with the Inject() step. Could you please create an issue with the TinkerPop (to which Gremlin.Net belongs) project here: https://issues.apache.org/jira/browse/TINKERPOP/ ?
Your second example with your own class XXX however cannot work as Gremlin.Net and Gremlin Server / JanusGraph Server cannot know how to serialize / deserialize this type. You would need to write your own serializer and deserializer for this type to make it work.
Von: janusgraph-users@... <janusgraph-users@...> Im Auftrag von bill.poole via lists.lfaidata.foundation
Hi All – I’m trying to use the withSideEffect() configuration to add a list of maps to GraphTraversalSource like is done in the Long Traversals recipe and the server throws an exception – “Could not deserialize the Traversal instance java.lang.IllegalStateException: Could not locate method: GraphTraversalSource.withSideEffect(String, LinkedHashMap, LinkedHashMap)”
The .NET code that reproduces the error:
var server = new GremlinServer("localhost", port: 8182); var client = JanusGraphClientBuilder.BuildClientForServer(server).Create(); using var connection = new DriverRemoteConnection(client); var g = AnonymousTraversalSource.Traversal().WithRemote(connection);
var xxx = new[] { new Dictionary<object, object> { { "x", 1 }, { "y", 2 } }, new Dictionary<object, object> { { "x", 3 }, { "y", 4 } } };
await g.WithSideEffect("xxx", xxx).V().Promise(t => t.ToList());
The same result is produced using an array of strongly typed objects:
public class XXX { public int X { get; init; } public int Y { get; init; } }
var server = new GremlinServer("localhost", port: 8182); var client = JanusGraphClientBuilder.BuildClientForServer(server).Create(); using var connection = new DriverRemoteConnection(client); var g = AnonymousTraversalSource.Traversal().WithRemote(connection);
var xxx = new[] { new XXX { X = 1, Y = 2 }, new XXX { X = 3, Y = 4 } };
await g.WithSideEffect("xxx", xxx).V().Promise(t => t.ToList());
However, the “inject” step works fine passing an array of maps:
await g.Inject<object>(xxx).Promise(t => t.ToList());
Invoking “withSideEffect” produces the following error on the server:
ERROR org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor - Could not deserialize the Traversal instance java.lang.IllegalStateException: Could not locate method: GraphTraversalSource.withSideEffect(String, LinkedHashMap, LinkedHashMap) at org.apache.tinkerpop.gremlin.jsr223.JavaTranslator.invokeMethod(JavaTranslator.java:300) at org.apache.tinkerpop.gremlin.jsr223.JavaTranslator.translate(JavaTranslator.java:85) at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.iterateBytecodeTraversal(TraversalOpProcessor.java:181) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:67) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:43) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:82) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.lang.Thread.run(Thread.java:750) 31637 [gremlin-server-worker-1] WARN org.apache.tinkerpop.gremlin.server.handler.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.iterateBytecodeTraversal(TraversalOpProcessor.java:195) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:67) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:43) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:82) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.lang.Thread.run(Thread.java:750)
Is this a bug, or am I doing something wrong?
- Bill
|
|
Cannot pass list of maps to withSideEffect
bill.poole@...
Hi All – I’m trying to use the withSideEffect() configuration to add a list of maps to GraphTraversalSource like is done in the Long Traversals recipe and the server throws an exception – “Could not deserialize the Traversal instance java.lang.IllegalStateException: Could not locate method: GraphTraversalSource.withSideEffect(String, LinkedHashMap, LinkedHashMap)”
The .NET code that reproduces the error:
var server = new GremlinServer("localhost", port: 8182); var client = JanusGraphClientBuilder.BuildClientForServer(server).Create(); using var connection = new DriverRemoteConnection(client); var g = AnonymousTraversalSource.Traversal().WithRemote(connection);
var xxx = new[] { new Dictionary<object, object> { { "x", 1 }, { "y", 2 } }, new Dictionary<object, object> { { "x", 3 }, { "y", 4 } } };
await g.WithSideEffect("xxx", xxx).V().Promise(t => t.ToList());
The same result is produced using an array of strongly typed objects:
public class XXX { public int X { get; init; } public int Y { get; init; } }
var server = new GremlinServer("localhost", port: 8182); var client = JanusGraphClientBuilder.BuildClientForServer(server).Create(); using var connection = new DriverRemoteConnection(client); var g = AnonymousTraversalSource.Traversal().WithRemote(connection);
var xxx = new[] { new XXX { X = 1, Y = 2 }, new XXX { X = 3, Y = 4 } };
await g.WithSideEffect("xxx", xxx).V().Promise(t => t.ToList());
However, the “inject” step works fine passing an array of maps:
await g.Inject<object>(xxx).Promise(t => t.ToList());
Invoking “withSideEffect” produces the following error on the server:
ERROR org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor - Could not deserialize the Traversal instance java.lang.IllegalStateException: Could not locate method: GraphTraversalSource.withSideEffect(String, LinkedHashMap, LinkedHashMap) at org.apache.tinkerpop.gremlin.jsr223.JavaTranslator.invokeMethod(JavaTranslator.java:300) at org.apache.tinkerpop.gremlin.jsr223.JavaTranslator.translate(JavaTranslator.java:85) at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.iterateBytecodeTraversal(TraversalOpProcessor.java:181) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:67) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:43) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:82) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.lang.Thread.run(Thread.java:750) 31637 [gremlin-server-worker-1] WARN org.apache.tinkerpop.gremlin.server.handler.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.iterateBytecodeTraversal(TraversalOpProcessor.java:195) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:67) at org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:43) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:82) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.lang.Thread.run(Thread.java:750)
Is this a bug, or am I doing something wrong?
- Bill
|
|
Re: Java Heap Space - Vertex.edges
Joe Obernberger
Thank you Marc and Boxuan - I tried using vertex cut, but it appears to lead toward graph corruption (ie zombie nodes - see thread on 'graph corruption'). Agree that I need a new approach. This proxy approach is hurting my brain, but I think it will work for what I want to do. Awesome reference - thank you Boxuan! -Joe On 8/31/2022 12:46 AM, Boxuan Li wrote:
Hi Joe,
|
|
Re: Java Heap Space - Vertex.edges
Boxuan Li
Also, your observation is correct that `inE().toList();` can lead to OOM simply because `outE()` size is very large. As Marc pointed out, in this case you have to specify the label `inE('your-label')` to avoid OOM. Of course, this does not solve the real problem because you anyways would have a problem when you need to traverse `outE()`. You either need to revisit your data model, or try out the POC I mentioned in the previous comment.
|
|
Re: Java Heap Space - Vertex.edges
Boxuan Li
Hi Joe,
Unfortunately, JanusGraph does not support super node (a vertex with millions of neighbors) well. And yes, you probably need to remodel your graph. Alternatively, there is a POC that allows you to create proxy nodes when a node becomes a super node: https://github.com/JanusGraph/janusgraph/discussions/2717 but it also requires that you write some custom client code. Let me know if you have any questions. Best, Boxuan
|
|
Re: Java Heap Space - Vertex.edges
hadoopmarc@...
Hi Joe,
The section in the blog "When Predicate Pushdown Fails" shows that you definitely have to include the edge label, so: .inE('your-label') Best wishes, Marc
|
|
Re: Java Heap Space - Vertex.edges
Joe Obernberger
Thank you Marc - I tried something like this: myId is an indexed field. This also runs out of memory if the
outE() size is very large. At least that's what appears to be
happening. The size of the inE is small (less than 10 nodes).
The outE size can be very large. It seems that we can't have
graphs with a large number of edges on a single node. The graph
can also result in very large partition sizes in Cassandra (in my
case about 650MBytes): Seeing this; would I need to redesign the
graph? What I'm trying now is limiting the number of edges on a
node, but that seems opposed to why I'm using a graph in the first
place. nodetool tablehistograms
graphsource.edgestore -Joe On 8/28/2022 4:50 AM,
hadoopmarc@... wrote:
Hi Joe,
|
|
Re: Deserializer for "janusgraph:RelationIdentifier" not found
Florian Hockmann
But you are subscribed to the list and you are getting other messages here?
Am I not using JanusGraph.Net correctly?
Can you please show how you are creating the client and the GraphTraversalSource? If you are using the JanusGraphClientBuilder, then it should be using the JanusGraph.Net serializers.
Von: janusgraph-users@... <janusgraph-users@...> Im Auftrag von bill.poole via lists.lfaidata.foundation
Hello again – I’m responding to this thread. I saw the response to my original email via the web interface, but never received it by email, so cannot send this as a reply to that email.
In my original email I said:
Hi All – I’m getting error “Deserializer for "janusgraph:RelationIdentifier" not found” when executing the below traversal using JanusGraph.Net:
await gtx.AddV("person").AddE("whatever").Promise(t => t.Iterate());
Florian Hockmann was very helpful to reply with:
the error is telling you that Gremlin.Net cannot deserialize the GraphSON type “janusgraph:RelationIdentifier”. That’s because it’s a JanusGraph specific type and Gremlin.Net doesn’t know anything about such types.
That is why we’ve built JanusGraph.Net: https://github.com/JanusGraph/janusgraph-dotnet/ It’s a .NET library that simply extends Gremlin.Net for such JanusGraph specific types like RelationIdentifier. Switching to that library should solve these problems. It also make it easy to always have a version of the .NET driver that is compatible with your JanusGraph Server version.
However, I was actually using the JanusGraph.Net client – specifically version 0.4.1, the latest available on NuGet.
Am I not using JanusGraph.Net correctly?
Regards, Bill
|
|
Re: Java Heap Space - Vertex.edges
hadoopmarc@...
Hi Joe,
Can you take a look at this blog from Boxuan Li: https://li-boxuan.medium.com/janusgraph-deep-dive-part-3-speed-up-edge-queries-3b9eb5ba34f8 In general, it is better to use the TinkerPop API starting with g.V(). This makes sure you do not skip query optimizations. In addition, it makes your code more portable with respect to other TinkerPop-compatible graph systems. I am not sure though if this will really help for your use case, but give it a try! Best wishes, Marc
|
|
Deserializer for "janusgraph:RelationIdentifier" not found
bill.poole@...
Hello again – I’m responding to this thread. I saw the response to my original email via the web interface, but never received it by email, so cannot send this as a reply to that email.
In my original email I said:
Hi All – I’m getting error “Deserializer for "janusgraph:RelationIdentifier" not found” when executing the below traversal using JanusGraph.Net:
await gtx.AddV("person").AddE("whatever").Promise(t => t.Iterate());
Florian Hockmann was very helpful to reply with:
the error is telling you that Gremlin.Net cannot deserialize the GraphSON type “janusgraph:RelationIdentifier”. That’s because it’s a JanusGraph specific type and Gremlin.Net doesn’t know anything about such types.
That is why we’ve built JanusGraph.Net: https://github.com/JanusGraph/janusgraph-dotnet/ It’s a .NET library that simply extends Gremlin.Net for such JanusGraph specific types like RelationIdentifier. Switching to that library should solve these problems. It also make it easy to always have a version of the .NET driver that is compatible with your JanusGraph Server version.
However, I was actually using the JanusGraph.Net client – specifically version 0.4.1, the latest available on NuGet.
Am I not using JanusGraph.Net correctly?
Regards, Bill
|
|