MASTER_RESULT - master result for computation in each iteration.WORKER_RESULT - worker result for computation in each iteration.public class SyncMasterCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable> extends AbstractMasterCoordinator<MASTER_RESULT,WORKER_RESULT>
SyncMasterCoordinator is used to as a barrier for each iteration.
For each iteration, SyncMasterCoordinator will wait until all workers are done.
To start a new iteration, SyncMasterCoordinator will write a znode for each iteration like
'/_guagua/job_201312041304_189025/master/{currentIteration}' with with MasterComputable MASTER_RESULT,
WORKER_RESULT as its data. This is like a signal to notify workers.
Workers are waiting on current master znode, if got current master znode, it will start another iteration
AbstractMasterCoordinator.FailOverCommand, AbstractMasterCoordinator.MasterElectionCommandBasicCoordinator.BasicCoordinatorCommand, BasicCoordinator.CoordinatorCommand, BasicCoordinator.GetSplitBytes, BasicCoordinator.RetryCoordinatorCommand, BasicCoordinator.SaveResultToZookeeperWAIT_SLOT_MILLS| Constructor and Description |
|---|
SyncMasterCoordinator() |
| Modifier and Type | Method and Description |
|---|---|
void |
preApplication(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
The hook point before any computation logic.
|
void |
preIteration(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
The hook point before computation of each iteration.
|
getMyBid, isAllWorkersHalt, postApplication, postIteration, setMasterResult, setMyBid, setWorkerResults, updateMasterHaltStatuscheckAndSetZooKeeper, close, getAppNode, getBaseMasterElectionNode, getBytesFromZNode, getCurrentMasterNode, getCurrentMasterSplitNode, getCurrentWorkerNode, getCurrentWorkerSplitNode, getLastMasterNode, getLastWorkerNode, getMasterBaseNode, getMasterElectionNode, getMasterNode, getMasterSerializer, getRootNode, getSleepTime, getWorkerBaseNode, getWorkerBaseNode, getWorkerNode, getWorkerSerializer, getZkConnLatch, getZooKeeper, initialize, isFixedTime, process, setBytesToZNode, setFixedTime, setMasterSerializer, setSleepTime, setWorkerSerializer, setZooKeeper, startHeartbeat, stopHeartBeatpublic void preApplication(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
MasterInterceptorcontext - the master context instance which includes worker results and other useful parameters.public void preIteration(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
MasterInterceptorcontext - the master context instance which includes worker results and other useful parameters.Copyright © 2019. All Rights Reserved.