ml.shifu.guagua.worker
类 WorkerContext<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>
java.lang.Object
ml.shifu.guagua.worker.WorkerContext<MASTER_RESULT,WORKER_RESULT>
- 类型参数:
MASTER_RESULT - master result for computation in each iteration.WORKER_RESULT - worker result for computation in each iteration.
public class WorkerContext<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>
- extends Object
WorkerContext is a context to contain all useful info which can be used in worker computation.
The info includes:
- Application ID: Job ID for Hadoop mapreduce Job, application ID for YARN application.
- Container ID: Task index for Hadoop mapreduce task, Task index for YARN Container.
- Total iteration number.
- Current iteration number.
- Worker result for current iteration after computation which is used to be sent to master.
- Master result from last iteration.
WorkerContext
public WorkerContext(int totalIteration,
String appId,
Properties props,
String containerId,
List<GuaguaFileSplit> fileSplits,
String masterResultClassName,
String workerResultClassName)
getCurrentIteration
public int getCurrentIteration()
setCurrentIteration
public void setCurrentIteration(int currentIteration)
getTotalIteration
public int getTotalIteration()
getLastMasterResult
public MASTER_RESULT getLastMasterResult()
setLastMasterResult
public void setLastMasterResult(MASTER_RESULT lastMasterResult)
getAppId
public String getAppId()
getContainerId
public String getContainerId()
getFileSplits
public List<GuaguaFileSplit> getFileSplits()
getProps
public Properties getProps()
getWorkerResult
public WORKER_RESULT getWorkerResult()
getWorkerResultClassName
public String getWorkerResultClassName()
getMasterResultClassName
public String getMasterResultClassName()
getAttachment
public Object getAttachment()
setAttachment
public void setAttachment(Object attachment)
toString
public String toString()
- 覆盖:
- 类
Object 中的 toString
Copyright © 2014. All Rights Reserved.