}
}
// conf file
Pipeline pipeline = null;
HadoopConfFile confFileObj = null;
if (xqueryengine.equals("zorba")) {
pipeline = new Pipeline(querytext, XadoopConstants.PIPELINE_MAPPREFIX);
XQueryMRZorbaConfFile confFileObjTmp = new XQueryMRZorbaConfFile(config);
confFileObjTmp.setPipeline(pipeline.toString());
System.out.println(pipeline.toString());
confFileObjTmp.setQueryFile("/" + FILENAME_QUERY);
confFileObj = confFileObjTmp;
} else if (xqueryengine.equals("saxon")){
pipeline = new Pipeline(querytext, XadoopConstants.SAXON_PIPELINE_MAPPREFIX);
XQueryMRSaxonConfFile confFileObjTmp = new XQueryMRSaxonConfFile(config);
confFileObjTmp.setPipeline(pipeline.toString());
confFileObjTmp.setProlog("/" + FILENAME_QUERY);
confFileObjTmp.setStreamEnabled(streamingEnabled);
confFileObj = confFileObjTmp;
} else {
pipeline = new Pipeline(querytext, XadoopConstants.XQUERYMR_PIPELINE_MAPPREFIX);
XQueryMRConfFile confFileObjTmp = new XQueryMRConfFile();
confFileObjTmp.setPipeline(pipeline.toString());
confFileObjTmp.setProlog("/" + FILENAME_QUERY);
confFileObj = confFileObjTmp;
}
int numMapTasks = numTasksMap;
int numReduceTasks = numTasksReduce;
confFileObj.setMapredMapTasks(numMapTasks);
confFileObj.setMapredReduceTasks(numReduceTasks);
File confFile = new File(pathExecDir + FILENAME_CONF);
try {
FileWriter writer = new FileWriter(confFile);
writer.write(confFileObj.toXml());
writer.close();
} catch (IOException e) {
return new Failure("Failure writing conf file: " + e.getMessage());
}