如何更改 Janusgraph 的 Goblin OGM 序列化程序版本 (TinkerPop 3.2.6) #101
How to change version of Goblin OGM Serializer for Janusgraph (TinkerPop 3.2.6) #101
我正在尝试 Python 应用程序连接到 Janusgraph 0.2.0。我遵循了所有设置说明,并且能够在图中创建元素并成功遍历它们。
import asyncio
from goblin import Goblin
from quart import jsonify, Quart, serving
from app.models import Person, Knows
loop = asyncio.get_event_loop()
goblin_app = loop.run_until_complete(Goblin.open(loop,
hosts = ['localhost'],
port = '8182',
scheme = 'ws'))
goblin_app.register(Person, Knows)
print("Initialized all the goblin stuff")
quart_app = Quart(name)
async def create(app, data):
session = await app.session()
session.add(data)
await session.flush()
return data
leif = Person()
leif.name = 'Leif'
leif.age = 28
leif = loop.run_until_complete(create(goblin_app, leif))
jon = Person()
jon.name = 'Jon'
jon.age = 32
jon = loop.run_until_complete(create(goblin_app, jon))
works_with = Knows(leif, jon)
works_with = loop.run_until_complete(goblin_app, works_with)
但是,当我尝试从我的应用程序连接并发送 session.flush() 来创建元素时,应用程序冻结并且没有其他任何反应。
在 gremlin-server.log 中,我看到以下错误:
1109015 [gremlin-server-worker-1] WARN
org.apache.tinkerpop.gremlin.server.handler.WsGremlinBinaryRequestDecoder
- Gremlin Server is not configured with a serializer for the requested mime type [application/vnd.gremlin-v3.0+json] - using
org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0
by default 1109035 [gremlin-server-worker-1] WARN
org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV1d0
- Request [PooledUnsafeDirectByteBuf(ridx: 558, widx: 558, cap: 592)] could not be deserialized by
org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV1d0.
1109039 [gremlin-server-worker-1] WARN
org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler -
Invalid OpProcessor requested [null]
org.apache.tinkerpop.gremlin.server.op.OpProcessorException: Invalid
OpProcessor requested [null] at
org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler.decode(OpSelectorHandler.java:95)
at
org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler.decode(OpSelectorHandler.java:50)
at
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at
io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler.channelRead(WebSocketServerProtocolHandler.java:159)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at
io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:312)
at
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:286)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at
io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1302)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:646)
at
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:581)
at
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460) at
io.netty.util.concurrent.SingleThreadEventExecutor.run(SingleThreadEventExecutor.java:131)
at java.lang.Thread.run(Thread.java:745) ~
我找到了一些关于替换 gremlin-server.yaml 文件中的 GraphSON 版本的信息,以添加 gremlin-v3.0+json 缺少的序列化程序,但是我做到了当我添加时,我收到有关无法找到配置的序列化器 class 的错误消息:
10348 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - 找不到配置的序列化程序 class - org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 - 它将不可用 1
所以我的问题是:
- 有没有一种方法可以将我的应用程序发送到 Gremlin 服务器的序列化器版本更改为兼容版本之一
- 如果我下载GraphSON 3.0版放在服务器上可以吗?这意味着我将不得不升级 Janusgraph 打包的 Gremlin Server 版本,这似乎太多了...
有没有人运行遇到过类似的问题并且有什么建议?
检查并确保 gremlinpython
版本与 JanusGraph 0.2.0 使用的 Apache TinkerPop 版本 3.2.6 一致。
我正在尝试 Python 应用程序连接到 Janusgraph 0.2.0。我遵循了所有设置说明,并且能够在图中创建元素并成功遍历它们。
import asyncio
from goblin import Goblin
from quart import jsonify, Quart, serving
from app.models import Person, Knows
loop = asyncio.get_event_loop()
goblin_app = loop.run_until_complete(Goblin.open(loop,
hosts = ['localhost'],
port = '8182',
scheme = 'ws'))
goblin_app.register(Person, Knows)
print("Initialized all the goblin stuff")
quart_app = Quart(name)
async def create(app, data):
session = await app.session()
session.add(data)
await session.flush()
return data
leif = Person()
leif.name = 'Leif'
leif.age = 28
leif = loop.run_until_complete(create(goblin_app, leif))
jon = Person()
jon.name = 'Jon'
jon.age = 32
jon = loop.run_until_complete(create(goblin_app, jon))
works_with = Knows(leif, jon)
works_with = loop.run_until_complete(goblin_app, works_with)
但是,当我尝试从我的应用程序连接并发送 session.flush() 来创建元素时,应用程序冻结并且没有其他任何反应。 在 gremlin-server.log 中,我看到以下错误:
1109015 [gremlin-server-worker-1] WARN org.apache.tinkerpop.gremlin.server.handler.WsGremlinBinaryRequestDecoder - Gremlin Server is not configured with a serializer for the requested mime type [application/vnd.gremlin-v3.0+json] - using org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 by default 1109035 [gremlin-server-worker-1] WARN org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV1d0 - Request [PooledUnsafeDirectByteBuf(ridx: 558, widx: 558, cap: 592)] could not be deserialized by org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV1d0. 1109039 [gremlin-server-worker-1] WARN org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler - Invalid OpProcessor requested [null] org.apache.tinkerpop.gremlin.server.op.OpProcessorException: Invalid OpProcessor requested [null] at org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler.decode(OpSelectorHandler.java:95) at org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler.decode(OpSelectorHandler.java:50) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335) at io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler.channelRead(WebSocketServerProtocolHandler.java:159) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:312) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1302) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:646) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:581) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460) at io.netty.util.concurrent.SingleThreadEventExecutor.run(SingleThreadEventExecutor.java:131) at java.lang.Thread.run(Thread.java:745) ~
我找到了一些关于替换 gremlin-server.yaml 文件中的 GraphSON 版本的信息,以添加 gremlin-v3.0+json 缺少的序列化程序,但是我做到了当我添加时,我收到有关无法找到配置的序列化器 class 的错误消息: 10348 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - 找不到配置的序列化程序 class - org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 - 它将不可用 1
所以我的问题是:
- 有没有一种方法可以将我的应用程序发送到 Gremlin 服务器的序列化器版本更改为兼容版本之一
- 如果我下载GraphSON 3.0版放在服务器上可以吗?这意味着我将不得不升级 Janusgraph 打包的 Gremlin Server 版本,这似乎太多了...
有没有人运行遇到过类似的问题并且有什么建议?
检查并确保 gremlinpython
版本与 JanusGraph 0.2.0 使用的 Apache TinkerPop 版本 3.2.6 一致。