use of com.baidu.hugegraph.computer.core.input.WorkerInputManager in project hugegraph-computer by hugegraph.
the class WorkerService method inputstep.
/**
* 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("{} WorkerService inputstep started", this);
WorkerInputManager manager = this.managers.get(WorkerInputManager.NAME);
manager.loadGraph();
this.bsp4Worker.workerInputDone();
this.bsp4Worker.waitMasterInputDone();
WorkerStat workerStat = this.computeManager.input();
this.bsp4Worker.workerStepDone(Constants.INPUT_SUPERSTEP, workerStat);
SuperstepStat superstepStat = this.bsp4Worker.waitMasterStepDone(Constants.INPUT_SUPERSTEP);
manager.close(this.config);
LOG.info("{} WorkerService inputstep finished", this);
return superstepStat;
}
use of com.baidu.hugegraph.computer.core.input.WorkerInputManager in project hugegraph-computer by hugegraph.
the class WorkerService method initManagers.
private InetSocketAddress initManagers(ContainerInfo masterInfo) {
// Create managers
WorkerRpcManager rpcManager = new WorkerRpcManager();
this.managers.add(rpcManager);
/*
* NOTE: this init() method will be called twice, will be ignored at
* the 2nd time call.
*/
WorkerRpcManager.updateRpcRemoteServerConfig(this.config, masterInfo.hostname(), masterInfo.rpcPort());
rpcManager.init(this.config);
WorkerAggrManager aggregatorManager = new WorkerAggrManager(this.context);
aggregatorManager.service(rpcManager.aggregateRpcService());
this.managers.add(aggregatorManager);
FileManager fileManager = new FileManager();
this.managers.add(fileManager);
SortManager recvSortManager = new RecvSortManager(this.context);
this.managers.add(recvSortManager);
MessageRecvManager recvManager = new MessageRecvManager(this.context, fileManager, recvSortManager);
this.managers.add(recvManager);
ConnectionManager connManager = new TransportConnectionManager();
DataServerManager serverManager = new DataServerManager(connManager, recvManager);
this.managers.add(serverManager);
DataClientManager clientManager = new DataClientManager(connManager, this.context);
this.managers.add(clientManager);
SortManager sendSortManager = new SendSortManager(this.context);
this.managers.add(sendSortManager);
MessageSendManager sendManager = new MessageSendManager(this.context, sendSortManager, clientManager.sender());
this.managers.add(sendManager);
WorkerInputManager inputManager = new WorkerInputManager(this.context, sendManager);
inputManager.service(rpcManager.inputSplitService());
this.managers.add(inputManager);
// Init all managers
this.managers.initAll(this.config);
InetSocketAddress address = serverManager.address();
LOG.info("{} WorkerService initialized managers with data server " + "address '{}'", this, address);
return address;
}
Aggregations