ml.shifu.guagua.worker
接口 WorkerInterceptor<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>

类型参数:
MASTER_RESULT - master result for computation in each iteration.
WORKER_RESULT - worker result for computation in each iteration.
所有已知实现类:
AbstractWorkerCoordinator, AsyncWorkerCoordinator, BasicWorkerInterceptor, InternalWorkerCoordinator, MemoryStatsWorkerInterceptor, SyncWorkerCoordinator, TraceWorkerInterceptor, WorkerComputableTimer, WorkerTimer

public interface WorkerInterceptor<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>

WorkerInterceptor is a entry point for all services in worker implementation.

You can add your coordinator mechanism by using one WorkerInterceptor; you can also save each iteration result by override WorkerIntercepter#postApplication(MasterContext).

For a list of intercepters, the order to call preXXX methods and postXXX methods is different. For example, a and b two intercepters. The order is a.preApplication->b.preApplication->a.preIteration->b.preIteration->computation->b.postIteration ->a.postIteration->b.postApplication->a.postApplication. This is like call stack to make sure each intercepter to intercept the whole other intercepters and computations.


方法摘要
 void postApplication(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
          The hook point for each application or each mapreduce job which is after all iterations completed.
 void postIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
          The hook point for each iteration which is after WorkerComputable.compute(WorkerContext).
 void preApplication(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
          The hook point for each application or each mapreduce job which is before all iterations started.
 void preIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
          The hook point for each iteration which is before WorkerComputable.compute(WorkerContext).
 

方法详细信息

preApplication

void preApplication(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
The hook point for each application or each mapreduce job which is before all iterations started.


preIteration

void preIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
The hook point for each iteration which is before WorkerComputable.compute(WorkerContext).


postIteration

void postIteration(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
The hook point for each iteration which is after WorkerComputable.compute(WorkerContext).


postApplication

void postApplication(WorkerContext<MASTER_RESULT,WORKER_RESULT> context)
The hook point for each application or each mapreduce job which is after all iterations completed.



Copyright © 2014. All Rights Reserved.