public class NettyWorkerCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable> extends AbstractWorkerCoordinator<MASTER_RESULT,WORKER_RESULT>
Worker results and iteration info is not stored in to znode like SyncWorkerCoordinator. For a big task with much more workers, this can decrease pressure on zookeeper. To leverage Netty, fast worker and master coordination is expected.
Master results are still stored into zookeeper for fail-over. Only one master per each job, this shouldn't be a burden to zookeeper.
AbstractWorkerCoordinator.FailOverCoordinatorCommandBasicCoordinator.BasicCoordinatorCommand, BasicCoordinator.CoordinatorCommand, BasicCoordinator.GetSplitBytes, BasicCoordinator.RetryCoordinatorCommand, BasicCoordinator.SaveResultToZookeeperWAIT_SLOT_MILLS| Constructor and Description |
|---|
NettyWorkerCoordinator() |
| Modifier and Type | Method and Description |
|---|---|
void |
postApplication(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
Send stop message to master and then clean resources.
|
void |
postIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
Send worker results to master; wait for current master stop; get current master result.
|
void |
preApplication(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
Worker coordinator initialization.
|
void |
preIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
The hook point before computation of each iteration.
|
setMasterResultcheckAndSetZooKeeper, 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(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
context - the worker context instance which includes master result and other useful parameters.public void preIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
WorkerInterceptorpreIteration in interface WorkerInterceptor<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>preIteration in class AbstractWorkerCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>context - the worker context instance which includes master result and other useful parameters.public void postIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
context - the worker context instance which includes master result and other useful parameters.public void postApplication(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
postApplication in interface WorkerInterceptor<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>postApplication in class AbstractWorkerCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>context - the worker context instance which includes master result and other useful parameters.Copyright © 2019. All Rights Reserved.