ml.shifu.guagua.master
类 AsyncMasterCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>

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

public class AsyncMasterCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>
extends AbstractMasterCoordinator<MASTER_RESULT,WORKER_RESULT>

AsyncMasterCoordinator is used to as a barrier for each iteration.

For each iteration, AsyncMasterCoordinator will wait until all workers are done.

To start a new iteration, AsyncMasterCoordinator will write a znode for each iteration like '/_guagua/job_201312041304_189025/master/{currentIteration}' with with MasterComputable 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.


嵌套类摘要
 
从类 ml.shifu.guagua.master.AbstractMasterCoordinator 继承的嵌套类/接口
AbstractMasterCoordinator.FailOverCommand, AbstractMasterCoordinator.MasterElectionCommand
 
从类 ml.shifu.guagua.BasicCoordinator 继承的嵌套类/接口
BasicCoordinator.BasicCoordinatorCommand, BasicCoordinator.CoordinatorCommand, BasicCoordinator.RetryCoordinatorCommand
 
从接口 org.apache.zookeeper.Watcher 继承的嵌套类/接口
org.apache.zookeeper.Watcher.Event
 
字段摘要
protected  ProgressLock workerInitLock
          Lock is used to check register info from all workers.
protected  ProgressLock workerIterationLock
          Lock is used to check iteration info from all workers.
 
从类 ml.shifu.guagua.BasicCoordinator 继承的字段
WAIT_SLOT_MILLS
 
构造方法摘要
AsyncMasterCoordinator()
           
 
方法摘要
 String getAppId()
           
 int getCurrentIteration()
           
 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.
 void process(org.apache.zookeeper.WatchedEvent event)
           
 void setAppId(String appId)
           
 void setCurrentIteration(int currentIteration)
           
 
从类 ml.shifu.guagua.master.AbstractMasterCoordinator 继承的方法
getMyBid, isAllWorkersHalt, postApplication, postIteration, setMyBid, setWorkerResults, updateMasterHaltStatus
 
从类 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
 

字段详细信息

workerInitLock

protected ProgressLock workerInitLock
Lock is used to check register info from all workers.


workerIterationLock

protected ProgressLock workerIterationLock
Lock is used to check iteration info from all workers.

构造方法详细信息

AsyncMasterCoordinator

public AsyncMasterCoordinator()
方法详细信息

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(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
从接口 MasterInterceptor 复制的描述
The hook point before any computation logic.

参数:
context - the master context instance which includes worker results and other useful parameters.

preIteration

public void preIteration(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
从接口 MasterInterceptor 复制的描述
The hook point before computation of each iteration.

参数:
context - the master context instance which includes worker results and other useful parameters.


Copyright © 2014. All Rights Reserved.