dosubot[bot] commented on issue #2385: URL: https://github.com/apache/incubator-hugegraph/issues/2385#issuecomment-1878011989
_🤖_ <!-- Greeting --> 你好 @imbajin,我是[Dosu](https://dosu.dev),一个可以帮助你解决问题和成为贡献者的机器人。在等待人类维护者的回复期间,我会尽力为你提供帮助。很高兴能够和你相识! <!-- Answer --> 您的理解基本正确,但是具体的实现细节可能会因为不同的查询类型和配置而有所不同。在HugeGraph中,一次完整的API读取(如Kneighbor)的过程大致如下: 1. 当向"/graphs/{graph}/traversers/kneighbor"端点发出GET请求时,会调用`get`方法。此方法接收源顶点、方向、边标签、深度、最大度和限制等参数。然后,它创建一个`KneighborTraverser`实例,并调用其`kneighbor`方法来获取源顶点的K邻居。如果`countOnly`参数为true,它将返回K邻居的数量;否则,它将返回K邻居的ID。 2. 当向同一端点发出POST请求时,会调用`post`方法。此方法接收一个`Request`对象,该对象包含源顶点、步骤、最大深度、限制以及是否返回顶点、路径和边的标志等参数。然后,它创建一个`KneighborTraverser`实例,并调用其`customizedKneighbor`方法来根据指定的步骤获取源顶点的K邻居。根据`Request`对象中的标志,它还可能返回与K邻居相关的顶点、路径和边。 至于HugeGraph-server是否支持多用户同时查询,多业务同时查询的问题,HugeGraph-server是设计为能够处理多个并发请求的。然而,实际的并发级别取决于服务器的配置和底层系统的资源。提供的代码没有显示任何明确的同步或锁定机制,这表明服务器依赖于底层数据库和系统资源来处理并发请求。 相关源码: - [hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/traversers/KneighborAPI.java](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/traversers/KneighborAPI.java) 如果您有更多的问题或需要进一步的解释,请随时提问。 ## Sources - [hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/traversers/KneighborAPI.java](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/traversers/KneighborAPI.java) - [hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/KneighborTraverser.java](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/KneighborTraverser.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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
