apache / incubator-hugegraph-computer

HugeGraph Computer - A distributed graph processing system for hugegraph (OLAP)
https://hugegraph.apache.org/docs/quickstart/hugegraph-computer/
Apache License 2.0
42 stars 41 forks source link

[Bug] Incorrect code comment #267

Closed diaohancai closed 11 months ago

diaohancai commented 11 months ago

Bug Type (问题类型)

None

Before submit

Environment (环境信息)

Expected & Actual behavior (期望与实际表现)

org.apache.hugegraph.computer.core.common.ContainerInfo found incorrect comment.

Incorrect comment:

/*
 * There is only 1 master, and the id of master is -1.
 * The id of workers start from 0. The id is used to identify a worker.
 */
private int id;

Actual code:

this.masterInfo = new ContainerInfo(ContainerInfo.MASTER_ID,
                                        TransportUtil.host(rpcAddress),
                                        rpcAddress.getPort());
int ContainerInfo.MASTER_ID = 0;
private void assignIdForWorkers(List<ContainerInfo> containers) {
    // Assign worker id from 1.
    for (int i = 0; i < containers.size(); i++) {
        containers.get(i).id(i + 1);
    }
}

So: