protected void executeTaskInit(String tmpCacheName) {
RpcManager rpc = cache.getRpcManager();
CommandsFactory factory = cache.getComponentRegistry().getComponent(CommandsFactory.class);
//first create tmp caches on all nodes
final CreateCacheCommand ccc = factory.buildCreateCacheCommand(tmpCacheName, DEFAULT_TMP_CACHE_CONFIGURATION_NAME, true, rpc.getMembers().size());
log.debugf("Invoking %s across members %s ", ccc, cache.getRpcManager().getMembers());
mapReduceManager.getExecutorService().submit(new Callable<Object>() {
@Override
public Object call() throws Exception {
//locally
ccc.init(cache.getCacheManager());
try {
return ccc.perform(null);
} catch (Throwable e) {
throw new CacheException("Could not initialize temporary caches for MapReduce task on remote nodes ", e);
}
}
});