ml.shifu.guagua.master
类 AbstractMasterCoordinator<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>
类型参数:
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
直接已知子类:
AsyncMasterCoordinator, SyncMasterCoordinator

public abstract class AbstractMasterCoordinator<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>
extends BasicCoordinator<MASTER_RESULT,WORKER_RESULT>
implements MasterInterceptor<MASTER_RESULT,WORKER_RESULT>

AbstractMasterCoordinator has some common implementation for both async and sync worker coordinator.

Common functions include: znodes cleaning up, fail-over support and others.


嵌套类摘要
protected  class AbstractMasterCoordinator.FailOverCommand
          AbstractMasterCoordinator.FailOverCommand is used to read last iteration before task failed.
protected  class AbstractMasterCoordinator.MasterElectionCommand
          Elect master from several backup masters.
 
从类 ml.shifu.guagua.BasicCoordinator 继承的嵌套类/接口
BasicCoordinator.BasicCoordinatorCommand, BasicCoordinator.CoordinatorCommand, BasicCoordinator.RetryCoordinatorCommand
 
从接口 org.apache.zookeeper.Watcher 继承的嵌套类/接口
org.apache.zookeeper.Watcher.Event
 
字段摘要
 
从类 ml.shifu.guagua.BasicCoordinator 继承的字段
WAIT_SLOT_MILLS
 
构造方法摘要
AbstractMasterCoordinator()
           
 
方法摘要
 String getMyBid()
           
protected  boolean isAllWorkersHalt(Iterable<WORKER_RESULT> workerResults)
          Check whether all workers are halted.
 void postApplication(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
          The hook point after any computation logic.
 void postIteration(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
          The hook point after computation of each iteration.
 void setMyBid(String myBid)
           
protected  void setWorkerResults(MasterContext<MASTER_RESULT,WORKER_RESULT> context, String appCurrentWorkersNode, String appId, int iteration)
          Set worker results from znodes.
protected  void updateMasterHaltStatus(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
          Check whether GuaguaConstants.GUAGUA_WORKER_HALT_ENABLE) is enabled, if yes, check whether all workers are halted and update master status.
 
从类 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, process, setBytesToZNode, setFixedTime, setMasterSerializer, setSleepTime, setWorkerSerializer, setZooKeeper, startHeartbeat, stopHeartBeat
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
从接口 ml.shifu.guagua.master.MasterInterceptor 继承的方法
preApplication, preIteration
 

构造方法详细信息

AbstractMasterCoordinator

public AbstractMasterCoordinator()
方法详细信息

postIteration

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

指定者:
接口 MasterInterceptor<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable> 中的 postIteration
参数:
context - the master context instance which includes worker results and other useful parameters.

postApplication

public void postApplication(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
从接口 MasterInterceptor 复制的描述
The hook point after any computation logic.

指定者:
接口 MasterInterceptor<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable> 中的 postApplication
参数:
context - the master context instance which includes worker results and other useful parameters.

setWorkerResults

protected void setWorkerResults(MasterContext<MASTER_RESULT,WORKER_RESULT> context,
                                String appCurrentWorkersNode,
                                String appId,
                                int iteration)
                         throws org.apache.zookeeper.KeeperException,
                                InterruptedException
Set worker results from znodes.

抛出:
org.apache.zookeeper.KeeperException
InterruptedException

updateMasterHaltStatus

protected void updateMasterHaltStatus(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
Check whether GuaguaConstants.GUAGUA_WORKER_HALT_ENABLE) is enabled, if yes, check whether all workers are halted and update master status.


isAllWorkersHalt

protected boolean isAllWorkersHalt(Iterable<WORKER_RESULT> workerResults)
Check whether all workers are halted.


getMyBid

public String getMyBid()

setMyBid

public void setMyBid(String myBid)


Copyright © 2014. All Rights Reserved.