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 for each application or each mapreduce job which is after all iterations completed.
 void postIteration(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
          The hook point for each iteration which is after MasterComputable.compute(MasterContext).
 void setMyBid(String myBid)
           
protected  void setWorkerResults(MasterContext<MASTER_RESULT,WORKER_RESULT> context, String appCurrentWorkersNode, String appId, int iteration)
          Set worker result 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 for each iteration which is after MasterComputable.compute(MasterContext).

指定者:
接口 MasterInterceptor<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable> 中的 postIteration

postApplication

public void postApplication(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
从接口 MasterInterceptor 复制的描述
The hook point for each application or each mapreduce job which is after all iterations completed.

指定者:
接口 MasterInterceptor<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable> 中的 postApplication

setWorkerResults

protected void setWorkerResults(MasterContext<MASTER_RESULT,WORKER_RESULT> context,
                                String appCurrentWorkersNode,
                                String appId,
                                int iteration)
                         throws org.apache.zookeeper.KeeperException,
                                InterruptedException
Set worker result 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.