Search in sources :

Example 1 with ComputeMessageRecvPartitions

use of com.baidu.hugegraph.computer.core.receiver.message.ComputeMessageRecvPartitions in project hugegraph-computer by hugegraph.

the class MessageRecvManager method messagePartitions.

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

Example 2 with ComputeMessageRecvPartitions

use of com.baidu.hugegraph.computer.core.receiver.message.ComputeMessageRecvPartitions in project hugegraph-computer by hugegraph.

the class MessageRecvManager method beforeSuperstep.

@Override
public void beforeSuperstep(Config config, int superstep) {
    SuperstepFileGenerator fileGenerator = new SuperstepFileGenerator(this.fileManager, superstep);
    this.messagePartitions = new ComputeMessageRecvPartitions(this.context, fileGenerator, this.sortManager);
    this.expectedFinishMessages = this.workerCount;
    this.finishMessagesLatch = new CountDownLatch(this.expectedFinishMessages);
    this.superstep = superstep;
    if (this.superstep == Constants.INPUT_SUPERSTEP + 1) {
        assert this.vertexPartitions != null;
        this.vertexPartitions.clearOldFiles(Constants.INPUT_SUPERSTEP);
        this.vertexPartitions = null;
        assert this.edgePartitions != null;
        this.edgePartitions.clearOldFiles(Constants.INPUT_SUPERSTEP);
        this.edgePartitions = null;
    }
}
Also used : SuperstepFileGenerator(com.baidu.hugegraph.computer.core.store.SuperstepFileGenerator) ComputeMessageRecvPartitions(com.baidu.hugegraph.computer.core.receiver.message.ComputeMessageRecvPartitions) CountDownLatch(java.util.concurrent.CountDownLatch)

Aggregations

ComputeMessageRecvPartitions (com.baidu.hugegraph.computer.core.receiver.message.ComputeMessageRecvPartitions)2 SuperstepFileGenerator (com.baidu.hugegraph.computer.core.store.SuperstepFileGenerator)1 CountDownLatch (java.util.concurrent.CountDownLatch)1