MASTER_RESULT - master result for computation in each iteration.WORKER_RESULT - worker result for computation in each iteration.public class MasterContext<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable> extends Object
MasterContext is a context object which contains all useful info used in master computation.
The info includes:
| Modifier and Type | Class and Description |
|---|---|
static interface |
MasterContext.MasterCompletionCallBack<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>
Define callback for completion of master computation.
|
| Constructor and Description |
|---|
MasterContext(int totalIteration,
int workers,
Properties props,
String appId,
String containerId,
String masterResultClassName,
String workerResultClassName,
double minWorkersRatio,
long minWorkersTimeOut) |
public MasterContext(int totalIteration,
int workers,
Properties props,
String appId,
String containerId,
String masterResultClassName,
String workerResultClassName,
double minWorkersRatio,
long minWorkersTimeOut)
public String getContainerId()
public Iterable<WORKER_RESULT> getWorkerResults()
public void setWorkerResults(Iterable<WORKER_RESULT> workerResults)
public int getTotalIteration()
public int getCurrentIteration()
public void setCurrentIteration(int currentIteration)
public int getWorkers()
public Properties getProps()
public String getAppId()
public MASTER_RESULT getMasterResult()
public void setMasterResult(MASTER_RESULT masterResult)
public String getMasterResultClassName()
public String getWorkerResultClassName()
public double getMinWorkersRatio()
public long getMinWorkersTimeOut()
public Object getAttachment()
public void setAttachment(Object attachment)
public boolean isFirstIteration()
public boolean isInitIteration()
public void addCompletionCallBack(MasterContext.MasterCompletionCallBack<MASTER_RESULT,WORKER_RESULT> callback)
public List<MasterContext.MasterCompletionCallBack<MASTER_RESULT,WORKER_RESULT>> getCallBackList()
Copyright © 2019. All Rights Reserved.