Closed solower closed 4 months ago
嗨,@solower!很高兴再次看到你的问题。希望你一切都好!
您遇到的错误 "No signature of method: org.apache.hugegraph.StandardHugeGraph.serverStarted() is applicable for argument types: (org.apache.hugegraph.backend.id.IdGenerator$StringId, org.apache.hugegraph.type.define.NodeRole) values: [server-tinkerpop, MASTER]" 表明 graph
对象上调用的 serverStarted
方法不接受您传递的参数。具体来说,方法签名与提供的参数 (IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)
不匹配。
这可能是由以下几个原因导致的:
方法签名更改:StandardHugeGraph
类中的 serverStarted
方法可能不存在您正在使用的参数。可能的情况是您正在使用的库版本中,方法签名已经更改,或者该方法期望的参数类型或数量不同。
库版本:如果代码片段在库的早期版本中可以正常工作,那么可能是您已经更新到了一个新版本,其中 serverStarted
方法已被修改、弃用或删除。库作者有时会更改 API,这可能导致此类问题。
使用不正确:也有可能 serverStarted
方法并不是按照脚本中的方式来使用的。这可能是对方法用途或参数的误解。
要解决此问题,您应该:
StandardHugeGraph
类的文档。验证 serverStarted
方法是否存在以及其正确的签名是什么。serverStarted
方法的重大更改或更新。serverStarted
方法的示例,或者寻求帮助。有时,库作者或社区可以提供更新的示例或澄清。没有访问您正在使用的库版本的源代码或文档的权限,这些都是您应该遵循的一般步骤,以解决和排查问题。
在 Apache HugeGraph(incubating) Release 1.2.0 中,StandardHugeGraph
类的 serverStarted
方法的正确签名是:
public void serverStarted(GlobalMasterInfo nodeInfo)
这意味着您需要传递一个 GlobalMasterInfo
类型的参数,而不是 (IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)
。您可能需要检查您的代码,确保您正在正确地使用 serverStarted
方法。
参考源码:
嗨,@solower!很高兴再次看到你的问题。希望你一切都好!
您遇到的错误 "No signature of method: org.apache.hugegraph.StandardHugeGraph.serverStarted() is applicable for argument types: (org.apache.hugegraph.backend.id.IdGenerator$StringId, org.apache.hugegraph.type.define.NodeRole) values: [server-tinkerpop, MASTER]" 表明
graph
对象上调用的serverStarted
方法不接受您传递的参数。具体来说,方法签名与提供的参数(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)
不匹配。这可能是由以下几个原因导致的:
- 方法签名更改:
StandardHugeGraph
类中的serverStarted
方法可能不存在您正在使用的参数。可能的情况是您正在使用的库版本中,方法签名已经更改,或者该方法期望的参数类型或数量不同。- 库版本:如果代码片段在库的早期版本中可以正常工作,那么可能是您已经更新到了一个新版本,其中
serverStarted
方法已被修改、弃用或删除。库作者有时会更改 API,这可能导致此类问题。- 使用不正确:也有可能
serverStarted
方法并不是按照脚本中的方式来使用的。这可能是对方法用途或参数的误解。要解决此问题,您应该:
- 查看文档:查找您正在使用的库版本的
StandardHugeGraph
类的文档。验证serverStarted
方法是否存在以及其正确的签名是什么。- 查看库更改:如果您最近更新了库,查看更改日志或发布说明中是否有对
serverStarted
方法的重大更改或更新。- 寻找示例或支持:在官方文档、论坛中寻找使用
serverStarted
方法的示例,或者寻求帮助。有时,库作者或社区可以提供更新的示例或澄清。没有访问您正在使用的库版本的源代码或文档的权限,这些都是您应该遵循的一般步骤,以解决和排查问题。
在 Apache HugeGraph(incubating) Release 1.2.0 中,
StandardHugeGraph
类的serverStarted
方法的正确签名是:public void serverStarted(GlobalMasterInfo nodeInfo)
这意味着您需要传递一个
GlobalMasterInfo
类型的参数,而不是(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)
。您可能需要检查您的代码,确保您正在正确地使用serverStarted
方法。参考源码:
Sources
- hugegraph-server/hugegraph-dist/src/assembly/static/scripts/example.groovy
- hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/StandardHugeGraph.java
About Dosu
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.
Good catch, this is because there was no corresponding modification to the call to serverStarted
in the example.groovy
script in https://github.com/apache/incubator-hugegraph/pull/2370.
Yes, your analysis is correct. The error you're encountering is due to the change in the method signature of serverStarted
in the StandardHugeGraph
class. As per the pull request https://github.com/apache/incubator-hugegraph/pull/2370, the method signature has been changed from public void serverStarted(GlobalMasterInfo nodeInfo)
to public void serverStarted()
.
This means that the serverStarted
method no longer accepts any parameters. Therefore, the call to serverStarted
in your example.groovy
script should be updated to match this new method signature.
You should change the line:
graph.serverStarted(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)
to:
graph.serverStarted()
This should resolve the issue you're encountering. Please try this solution and let me know if you encounter any further issues.
For future reference, when a method's signature is changed, all calls to that method need to be updated to match the new signature. This includes calls in scripts, tests, and any other places where the method is used.
You can find more information about the serverStarted
method and its usage in the StandardHugeGraph.java file and the example.groovy script.
@solower fixed in #2473
Yes, your analysis is correct. The error you're encountering is due to the change in the method signature of
serverStarted
in theStandardHugeGraph
class. As per the pull request #2370, the method signature has been changed frompublic void serverStarted(GlobalMasterInfo nodeInfo)
topublic void serverStarted()
.This means that the
serverStarted
method no longer accepts any parameters. Therefore, the call toserverStarted
in yourexample.groovy
script should be updated to match this new method signature.You should change the line:
graph.serverStarted(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)
to:
graph.serverStarted()
This should resolve the issue you're encountering. Please try this solution and let me know if you encounter any further issues.
For future reference, when a method's signature is changed, all calls to that method need to be updated to match the new signature. This includes calls in scripts, tests, and any other places where the method is used.
You can find more information about the
serverStarted
method and its usage in the StandardHugeGraph.java file and the example.groovy script.Sources
- hugegraph-server/hugegraph-dist/src/assembly/static/scripts/example.groovy
- hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/StandardHugeGraph.java
About Dosu
In #2370, what are the parameter changes for serverStarted
?
Bug Type (问题类型)
other exception / error (其他异常报错)
Before submit
Environment (环境信息)
Expected & Actual behavior (期望与实际表现)
预期正常导入测试数据
实际报错 Error in scripts/example.groovy at [29: graph.serverStarted(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)] - No signature of method: org.apache.hugegraph.StandardHugeGraph.serverStarted() is applicable for argument types: (org.apache.hugegraph.backend.id.IdGenerator$StringId, org.apache.hugegraph.type.define.NodeRole) values: [server-tinkerpop, MASTER] Possible solutions: serverStarted(org.apache.hugegraph.masterelection.GlobalMasterInfo)
Vertex/Edge example (问题点 / 边数据举例)
No response
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
No response