我正在尝试通过gremlin-java客户端(https://github.com/Azure-Samples/azure-cosmos-db-graph-java-getting-started)来解析CSV文件并在Cosmos db中创建节点和边。
我在此程序中更改了一些查询: 对于添加数据: 提交此Gremlin 87246查询:
gV()。has('id','1120-L合并时间表L')。fold()。coalesce(unfold(),addV('sub_schedule')。property('id','1120-L合并时间表L')。property('name','1120-L合并时间表L'))
用于创建边线:
gV()。hasLabel('parent')。has('id','1120')。addE('has')。to(gV()。hasLabel('state')。has('id' ,'FD'))
成功运行了将近6个小时后,出现了奇怪的错误:
Exception in thread "main" java.util.concurrent.ExecutionException: java.io.IOException: An existing connection was forcibly closed by the remote host
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
at GetStarted.WriteWithOriginalCSVData.main(WriteWithOriginalCSVData.java:158)
Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:221)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:899)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:275)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:652)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:575)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:489)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:451)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
at java.lang.Thread.run(Thread.java:745)
有人可以告诉我这种情况的可能原因吗?
要提及的是,我正在通过开放式连接从笔记本电脑远程调用此Java客户端,并点击了Azure服务(在其他位置)。
首先,我认为可能是因为我的互联网连接。但是,当它完成一些87-88k gremlin查询时,它确实会引发错误。 有人可以让我知道我在哪里错吗?