ml.shifu.guagua.master
接口 MasterInterceptor<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>

类型参数:
MASTER_RESULT - master computation result in each iteration.
WORKER_RESULT - worker computation result in each iteration.
所有已知实现类:
AbstractMasterCoordinator, AsyncMasterCoordinator, BasicMasterInterceptor, InternalMasterCoordinator, MasterComputableTimer, MasterTimer, MemoryStatsMasterInterceptor, SyncMasterCoordinator, TraceMasterInterceptor

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

MasterInterceptor is a entry point for all service in master implementation.

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

For a list of interceptors, the order to call preXXX methods and postXXX methods is different. For example, a and b two interceptors. 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 interceptor to intercept the whole other interceptors and computations.


方法摘要
 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 preApplication(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
          The hook point for each application or each mapreduce job which is before all iterations started.
 void preIteration(MasterContext<MASTER_RESULT,WORKER_RESULT> context)
          The hook point for each iteration which is before MasterComputable.compute(MasterContext).
 

方法详细信息

preApplication

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


preIteration

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


postIteration

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


postApplication

void postApplication(MasterContext<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.