ml.shifu.guagua.worker
类 AsyncWorkerCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>

java.lang.Object
  继承者 ml.shifu.guagua.BasicCoordinator<MASTER_RESULT,WORKER_RESULT>
      继承者 ml.shifu.guagua.worker.AbstractWorkerCoordinator<MASTER_RESULT,WORKER_RESULT>
          继承者 ml.shifu.guagua.worker.AsyncWorkerCoordinator<MASTER_RESULT,WORKER_RESULT>
类型参数:
MASTER_RESULT - master result for computation in each iteration.
WORKER_RESULT - worker result for computation in each iteration.
所有已实现的接口:
WorkerInterceptor<MASTER_RESULT,WORKER_RESULT>, org.apache.zookeeper.Watcher

public class AsyncWorkerCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>
extends AbstractWorkerCoordinator<MASTER_RESULT,WORKER_RESULT>

AsyncWorkerCoordinator is used to as a worker barrier for each iteration.

For each iteration, AsyncWorkerCoordinator will wait until master's signal.

To start a new iteration, SyncMasterCoordinator will write a znode for each iteration like '/_guagua/job_201312041304_189025/master/{currentIteration}' with with MasterComputable result as its data. AsyncWorkerCoordinator is trying to detect whether it exists, if yes, to start a new iteration.

Worker result will be written into each worker iteration znode for master to get.


嵌套类摘要
 
从类 ml.shifu.guagua.worker.AbstractWorkerCoordinator 继承的嵌套类/接口
AbstractWorkerCoordinator.FailOverCoordinatorCommand
 
从类 ml.shifu.guagua.BasicCoordinator 继承的嵌套类/接口
BasicCoordinator.BasicCoordinatorCommand, BasicCoordinator.CoordinatorCommand, BasicCoordinator.RetryCoordinatorCommand
 
从接口 org.apache.zookeeper.Watcher 继承的嵌套类/接口
org.apache.zookeeper.Watcher.Event
 
字段摘要
protected  ProgressLock masterInitLock
          Lock is used to check register info from master.
protected  ProgressLock masterIterationLock
          Lock is used to check iteration info from master.
 
从类 ml.shifu.guagua.BasicCoordinator 继承的字段
WAIT_SLOT_MILLS
 
构造方法摘要
AsyncWorkerCoordinator()
           
 
方法摘要
 String getAppId()
           
 int getCurrentIteration()
           
 void postIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
          The hook point for each iteration which is after WorkerComputable.compute(WorkerContext).
 void preApplication(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
          The hook point for each application or each mapreduce job which is before all iterations started.
 void preIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
          The hook point for each iteration which is before WorkerComputable.compute(WorkerContext).
 void process(org.apache.zookeeper.WatchedEvent event)
           
 void setAppId(String appId)
           
 void setCurrentIteration(int currentIteration)
           
 
从类 ml.shifu.guagua.worker.AbstractWorkerCoordinator 继承的方法
postApplication, setMasterResult
 
从类 ml.shifu.guagua.BasicCoordinator 继承的方法
checkAndSetZooKeeper, closeZooKeeper, getAppNode, getBaseMasterElectionNode, getBytesFromZNode, getCurrentMasterNode, getCurrentMasterSplitNode, getCurrentWorkerNode, getCurrentWorkerSplitNode, getLastMasterNode, getLastWorkerNode, getMasterBaseNode, getMasterElectionNode, getMasterNode, getMasterSerializer, getRootNode, getSleepTime, getWorkerBaseNode, getWorkerBaseNode, getWorkerNode, getWorkerSerializer, getZkConnLatch, getZooKeeper, initialize, isFixedTime, setBytesToZNode, setFixedTime, setMasterSerializer, setSleepTime, setWorkerSerializer, setZooKeeper, startHeartbeat, stopHeartBeat
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

masterInitLock

protected ProgressLock masterInitLock
Lock is used to check register info from master.


masterIterationLock

protected ProgressLock masterIterationLock
Lock is used to check iteration info from master.

构造方法详细信息

AsyncWorkerCoordinator

public AsyncWorkerCoordinator()
方法详细信息

process

public void process(org.apache.zookeeper.WatchedEvent event)
指定者:
接口 org.apache.zookeeper.Watcher 中的 process
覆盖:
BasicCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable> 中的 process

getCurrentIteration

public int getCurrentIteration()

setCurrentIteration

public void setCurrentIteration(int currentIteration)

getAppId

public String getAppId()

setAppId

public void setAppId(String appId)

preApplication

public void preApplication(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
从接口 WorkerInterceptor 复制的描述
The hook point for each application or each mapreduce job which is before all iterations started.


preIteration

public void preIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
从接口 WorkerInterceptor 复制的描述
The hook point for each iteration which is before WorkerComputable.compute(WorkerContext).

指定者:
接口 WorkerInterceptor<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable> 中的 preIteration
覆盖:
AbstractWorkerCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable> 中的 preIteration

postIteration

public void postIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
从接口 WorkerInterceptor 复制的描述
The hook point for each iteration which is after WorkerComputable.compute(WorkerContext).



Copyright © 2014. All Rights Reserved.