Search in sources :

Example 1 with VertexMessageRecvPartitions

use of com.baidu.hugegraph.computer.core.receiver.vertex.VertexMessageRecvPartitions 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 VertexMessageRecvPartitions

use of com.baidu.hugegraph.computer.core.receiver.vertex.VertexMessageRecvPartitions in project hugegraph-computer by hugegraph.

the class MessageRecvManager method vertexPartitions.

/**
 * Get the Iterator<KeyStore.Entry> of each partition.
 */
public Map<Integer, PeekableIterator<KvEntry>> vertexPartitions() {
    E.checkState(this.vertexPartitions != null, "The vertexPartitions can't be null");
    VertexMessageRecvPartitions partitions = this.vertexPartitions;
    return partitions.iterators();
}
Also used : VertexMessageRecvPartitions(com.baidu.hugegraph.computer.core.receiver.vertex.VertexMessageRecvPartitions)

Aggregations

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