@Override public MASTER_RESULT compute(MasterContext<MASTER_RESULT, WORKER_RESULT> context) { if(context.isFirstIteration()) { this.setup(context); context.addCompletionCallBack(new MasterCompletionCallBack<MASTER_RESULT, WORKER_RESULT>() { @Override public void callback(MasterContext<MASTER_RESULT, WORKER_RESULT> context) { cleanup(context); } }); } return doCompute(context); }