Search in sources :

Example 1 with EdgeMessageRecvPartitions

use of com.baidu.hugegraph.computer.core.receiver.edge.EdgeMessageRecvPartitions in project hugegraph-computer by hugegraph.

the class MessageRecvManager method init.

@Override
public void init(Config config) {
    SuperstepFileGenerator fileGenerator = new SuperstepFileGenerator(this.fileManager, Constants.INPUT_SUPERSTEP);
    this.vertexPartitions = new VertexMessageRecvPartitions(this.context, fileGenerator, this.sortManager);
    this.edgePartitions = new EdgeMessageRecvPartitions(this.context, fileGenerator, this.sortManager);
    this.workerCount = config.get(ComputerOptions.JOB_WORKERS_COUNT);
    // One for vertex and one for edge.
    this.expectedFinishMessages = this.workerCount * 2;
    this.finishMessagesLatch = new CountDownLatch(this.expectedFinishMessages);
    this.waitFinishMessagesTimeout = config.get(ComputerOptions.WORKER_WAIT_FINISH_MESSAGES_TIMEOUT);
}
Also used : VertexMessageRecvPartitions(com.baidu.hugegraph.computer.core.receiver.vertex.VertexMessageRecvPartitions) EdgeMessageRecvPartitions(com.baidu.hugegraph.computer.core.receiver.edge.EdgeMessageRecvPartitions) SuperstepFileGenerator(com.baidu.hugegraph.computer.core.store.SuperstepFileGenerator) CountDownLatch(java.util.concurrent.CountDownLatch)

Example 2 with EdgeMessageRecvPartitions

use of com.baidu.hugegraph.computer.core.receiver.edge.EdgeMessageRecvPartitions in project hugegraph-computer by hugegraph.

the class MessageRecvManager method edgePartitions.

public Map<Integer, PeekableIterator<KvEntry>> edgePartitions() {
    E.checkState(this.edgePartitions != null, "The edgePartitions can't be null");
    EdgeMessageRecvPartitions partitions = this.edgePartitions;
    return partitions.iterators();
}
Also used : EdgeMessageRecvPartitions(com.baidu.hugegraph.computer.core.receiver.edge.EdgeMessageRecvPartitions)

Aggregations

EdgeMessageRecvPartitions (com.baidu.hugegraph.computer.core.receiver.edge.EdgeMessageRecvPartitions)2 VertexMessageRecvPartitions (com.baidu.hugegraph.computer.core.receiver.vertex.VertexMessageRecvPartitions)1 SuperstepFileGenerator (com.baidu.hugegraph.computer.core.store.SuperstepFileGenerator)1 CountDownLatch (java.util.concurrent.CountDownLatch)1