// hook map function into lifecycle and execute it
MapReduceTaskLifecycleService taskLifecycleService = MapReduceTaskLifecycleService.getInstance();
DefaultCollector<KOut, VOut> collector = new DefaultCollector<KOut, VOut>();
log.tracef("For m/r task %s invoking %s with input keys %s", mcc.getTaskId(), mcc, inputKeys);
try {
taskLifecycleService.onPreExecute(mapper, cache);
for (KIn key : inputKeys) {
VIn value = cache.get(key);
mapper.map(key, value, collector);
if (inputKeysSpecified) {
inputKeysCopy.remove(key);