Search in sources :

Example 6 with SuperstepStat

use of com.baidu.hugegraph.computer.core.graph.SuperstepStat in project hugegraph-computer by hugegraph.

the class MasterService method inputstep.

/**
 * Coordinate with workers to load vertices and edges from HugeGraph. There
 * are two phases in inputstep. First phase is get input splits from
 * master, and read the vertices and edges from input splits. The second
 * phase is after all workers read input splits, the workers merge the
 * vertices and edges to get the stats for each partition.
 */
private SuperstepStat inputstep() {
    LOG.info("{} MasterService inputstep started", this);
    this.bsp4Master.waitWorkersInputDone();
    this.bsp4Master.masterInputDone();
    List<WorkerStat> workerStats = this.bsp4Master.waitWorkersStepDone(Constants.INPUT_SUPERSTEP);
    SuperstepStat superstepStat = SuperstepStat.from(workerStats);
    this.bsp4Master.masterStepDone(Constants.INPUT_SUPERSTEP, superstepStat);
    LOG.info("{} MasterService inputstep finished with superstat {}", this, superstepStat);
    return superstepStat;
}
Also used : SuperstepStat(com.baidu.hugegraph.computer.core.graph.SuperstepStat) WorkerStat(com.baidu.hugegraph.computer.core.worker.WorkerStat)

Aggregations

SuperstepStat (com.baidu.hugegraph.computer.core.graph.SuperstepStat)6 WorkerStat (com.baidu.hugegraph.computer.core.worker.WorkerStat)3 PartitionStat (com.baidu.hugegraph.computer.core.graph.partition.PartitionStat)1 WorkerInputManager (com.baidu.hugegraph.computer.core.input.WorkerInputManager)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 StopWatch (org.apache.commons.lang3.time.StopWatch)1 Test (org.junit.Test)1