Comments (3)
🤖
你好,@ycycyccc!很高兴再次见到你。🌀
您遇到的序列化问题可能是由于客户端和服务器之间的序列化/反序列化格式不匹配导致的。
在提供的上下文中,服务器配置为使用四种类型的序列化器:GraphBinaryMessageSerializerV1
,GraphSONMessageSerializerV1d0
,GraphSONMessageSerializerV2d0
和GraphSONMessageSerializerV3d0
。所有这些序列化器都配置为serializeResultToString: false
和ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
。
要解决序列化问题,您需要确保gremlin-go客户端使用与服务器相同的序列化/反序列化格式。如果服务器使用GraphBinaryMessageSerializerV1
,那么客户端也应使用GraphBinaryMessageSerializerV1
。同样,如果服务器使用GraphSONMessageSerializerV1d0
,GraphSONMessageSerializerV2d0
或GraphSONMessageSerializerV3d0
,那么客户端也应使用相应的GraphSONMessageSerializer
。
以下是如何在gremlin-go客户端中设置序列化器的示例:
import (
"github.com/apache/tinkerpop/gremlin-go"
)
func main() {
dialer := gremlin.NewDialer("ws://localhost:8183/gremlin",
gremlin.WithAuth("username", "password"), // if required
gremlin.WithSerializer( /* the matching serializer */ ),
)
client := gremlin.NewClient(dialer)
// ...
}
将/* the matching serializer */
替换为与服务器使用的序列化器匹配的序列化器。例如,如果服务器使用GraphSONMessageSerializerV3d0
,您可以使用gremlin.NewGraphSONv3Serializer()
。
请注意,gremlin-go客户端也应能够处理在org.apache.hugegraph.io.HugeGraphIoRegistry
中注册的自定义类型。如果客户端无法处理这些类型,您可能需要在客户端中为这些类型实现自定义序列化/反序列化。
参考资料:
Sources
- hugegraph-server/hugegraph-dist/src/assembly/travis/conf-raft3/gremlin-server.yaml
- hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/serializer/JsonSerializer.java
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
from incubator-hugegraph.
@ycycyccc 2 points may help:
- use gremlin-client v3.5.1 instead(keep consistent with our server)
- we do have a
hugegraph-go-client
inhuegegrpah-toolchain
repo(refer https://github.com/apache/incubator-hugegraph-toolchain/blob/master/hugegraph-client-go/README.md) , u don't need to usetinkerpop-gremlin-go
directly instead~
hugegraph-go-client
discussions: #2384
from incubator-hugegraph.
Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label
from incubator-hugegraph.
Related Issues (20)
- [Question] Same EdgeLabel on different VertexLabels HOT 5
- [Question] Hugegraph 支持 server 连接远程数据库进行查询吗 HOT 9
- Hugegraph如何构造query HOT 3
- [Bug] Dynamic create multi graph error with restful api in 1.2.0 HOT 8
- [Bug(pd-store)] hstore backend core tests failure HOT 4
- [Question] set restserver.url to http://0.0.0.0:8080 not work in 1.2 HOT 8
- [Bug] http://localhost:8080/gremlin have the null pointer error HOT 1
- [Question] gremlin console写入边如何配置不检查顶点是否存在 HOT 2
- [Bug] start server failed but still port in use HOT 1
- [Question] whats mean about this todo(ThreadLocal) HOT 2
- [Summary] Enhance code style warnings in server HOT 8
- [Bug] 换hugegraph-core-1.0.0.jar后,服务正常启动,但访问报“Please wait for the server to initialize” HOT 2
- [Bug(pd-store)] hstore backend api tests failure HOT 5
- [Question] When executing OLTP with a large amount of data, if the vertex ID type is String, an OOM exception will occur HOT 5
- [Bug] server slow log, support loader import & client IP HOT 1
- [Question] oltp时,客户端多线程查询时,报“Interrupted, maybe it is timed out” HOT 2
- [Bug] MissingMethodException in SchemaManager.removeIndexLabel() HOT 5
- [Bug] ./bin/gremlin-console.sh -- -i scripts/example.groovy 时一直报错 HOT 5
- [Question] Docker 1.2.0 server 内置 rocksdb 磁盘满了之后未自动清理 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from incubator-hugegraph.