throw new IllegalArgumentException("Can not use null cache for MapReduceTask");
ensureAccessPermissions(masterCacheNode.getAdvancedCache());
ensureProperCacheState(masterCacheNode.getAdvancedCache());
this.cache = masterCacheNode.getAdvancedCache();
this.keys = new LinkedList<KIn>();
ComponentRegistry componentRegistry = SecurityActions.getCacheComponentRegistry(cache);
this.marshaller = componentRegistry.getComponent(StreamingMarshaller.class, CACHE_MARSHALLER);
this.mapReduceManager = componentRegistry.getComponent(MapReduceManager.class);
this.cancellationService = componentRegistry.getComponent(CancellationService.class);
this.taskId = UUID.randomUUID();
if (useIntermediateSharedCache) {
this.customIntermediateCacheName = DEFAULT_TMP_CACHE_CONFIGURATION_NAME;
} else {
this.customIntermediateCacheName = taskId.toString();
}
this.distributeReducePhase = distributeReducePhase;
this.useIntermediateSharedCache = useIntermediateSharedCache;
this.cancellableTasks = Collections.synchronizedList(new ArrayList<CancellableTaskPart>());
this.clusteringDependentLogic = componentRegistry.getComponent(ClusteringDependentLogic.class);
this.isLocalOnly = SecurityActions.getCacheRpcManager(cache) == null;
this.rpcOptionsBuilder = isLocalOnly ? null : new RpcOptionsBuilder(SecurityActions.getCacheRpcManager(cache).getDefaultRpcOptions(true));
if (!isLocalOnly) {
this.rpcOptionsBuilder.timeout(0, TimeUnit.MILLISECONDS);
}