private MapCombineCommand<KIn, VIn, KOut, VOut> buildMapCombineCommand(
String taskId, Mapper<KIn, VIn, KOut, VOut> m, Reducer<KOut, VOut> r, String intermediateCacheName,
Collection<KIn> keys, boolean reducePhaseDistributed, boolean useIntermediateSharedCache){
ComponentRegistry registry = SecurityActions.getCacheComponentRegistry(cache);
CommandsFactory factory = registry.getComponent(CommandsFactory.class);
MapCombineCommand<KIn, VIn, KOut, VOut> c = factory.buildMapCombineCommand(taskId, m, r, keys);
c.setReducePhaseDistributed(reducePhaseDistributed);
c.setUseIntermediateSharedCache(useIntermediateSharedCache);
c.setIntermediateCacheName(intermediateCacheName);
c.setMaxCollectorSize(MAX_COLLECTOR_SIZE);
return c;