MASTER_RESULT - master result for computation in each iteration.WORKER_RESULT - worker result for computation in each iteration.public abstract class AbstractWorkerCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable> extends BasicCoordinator<MASTER_RESULT,WORKER_RESULT> implements WorkerInterceptor<MASTER_RESULT,WORKER_RESULT>
AbstractWorkerCoordinator has some common implementation for both async and sync worker coordinator.
Common functions include: znodes cleaning up, fail-over support and others.
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractWorkerCoordinator.FailOverCoordinatorCommand |
BasicCoordinator.BasicCoordinatorCommand, BasicCoordinator.CoordinatorCommand, BasicCoordinator.GetSplitBytes, BasicCoordinator.RetryCoordinatorCommand, BasicCoordinator.SaveResultToZookeeperWAIT_SLOT_MILLS| Constructor and Description |
|---|
AbstractWorkerCoordinator() |
| Modifier and Type | Method and Description |
|---|---|
void |
postApplication(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
The hook point after any computation logic.
|
void |
preIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
The hook point before computation of each iteration.
|
protected void |
setMasterResult(WorkerContext<MASTER_RESULT,WORKER_RESULT> context,
String appMasterNode,
String appMasterSplitNode) |
checkAndSetZooKeeper, 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, stopHeartBeatclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpostIteration, preApplicationpublic void preIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
WorkerInterceptorpreIteration in interface WorkerInterceptor<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>context - the worker context instance which includes master result and other useful parameters.public void postApplication(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
WorkerInterceptorpostApplication in interface WorkerInterceptor<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>context - the worker context instance which includes master result and other useful parameters.protected void setMasterResult(WorkerContext<MASTER_RESULT,WORKER_RESULT> context, String appMasterNode, String appMasterSplitNode) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionCopyright © 2019. All Rights Reserved.