init(cfg);
}
// NB: all changes to the config objects are discarded before the job is submitted if _the old MR api_ is used
private void init(Configuration cfg) throws IOException {
Settings settings = HadoopSettingsManager.loadFrom(cfg);
Assert.hasText(settings.getResourceWrite(), String.format("No resource ['%s'] (index/query/location) specified", ES_RESOURCE));
// lazy-init
RestRepository client = null;
InitializationUtils.checkIdForOperation(settings);
InitializationUtils.checkIndexExistence(settings, client);
if (HadoopCfgUtils.getReduceTasks(cfg) != null) {
if (HadoopCfgUtils.getSpeculativeReduce(cfg)) {
log.warn("Speculative execution enabled for reducer - consider disabling it to prevent data corruption");
}
}
else {
if (HadoopCfgUtils.getSpeculativeMap(cfg)) {
log.warn("Speculative execution enabled for mapper - consider disabling it to prevent data corruption");
}
}
Version.logVersion();
log.info(String.format("Writing to [%s]", settings.getResourceWrite()));
//log.info(String.format("Starting to write/index to [%s][%s]", settings.getTargetUri(), settings.getTargetResource()));
}