dosubot[bot] commented on issue #2667:
URL:
https://github.com/apache/incubator-hugegraph/issues/2667#issuecomment-2407243272
<!-- Answer -->
To allow task scheduling on a server with `server.role=computer` in a
standalone HugeGraph cluster using `backend=rocksdb`, you need to modify the
code to permit scheduling on a computer node. Here's how you can do it:
1. **Modify the Task Scheduling Check**: Update the logic in the
`StandardTaskScheduler` class to allow scheduling on a computer node.
Locate the `schedule` method and modify the master node check to include
the computer role:
```java
// Check this is on master or computer for normal task schedule
if (!this.serverManager().selfIsMaster() &&
!this.serverManager().selfIsComputer()) {
throw new HugeException("Can't schedule task on non-master and
non-computer server");
}
```
2. **Ensure Role Checking Method Exists**: Make sure the `ServerInfoManager`
class has a method `selfIsComputer()` to verify if the current server role is
`computer`.
Example implementation:
```java
public boolean selfIsComputer() {
return this.selfNodeRole() != null && this.selfNodeRole().computer();
}
```
By making these changes, the system will allow task scheduling on a server
with the `computer` role, resolving the error you encountered
<sup>[[1]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/StandardTaskScheduler.java)</sup><sup>[[2]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/ServerInfoManager.java)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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]