throw new RuntimeException(XLog.format("Could not get "+ testFileName, ioe));
}
}
private void addRecordToActionTable(String jobId, int actionNum, String actionId, CoordinatorStore store, String baseDir) throws StoreException, IOException {
CoordinatorActionBean action = new CoordinatorActionBean();
action.setJobId(jobId);
action.setId(actionId);
action.setActionNumber(actionNum);
action.setNominalTime(new Date());
action.setLastModifiedTime(new Date());
action.setStatus(CoordinatorAction.Status.SUBMITTED);
String appPath = baseDir + "/no-op/workflow.xml";
String baseURI = baseDir + "/workflows";
String actionXml = "<coordinator-app xmlns='uri:oozie:coordinator:0.2' xmlns:sla='uri:oozie:sla:0.1' name='NAME' frequency=\"1\" start='2009-02-01T01:00Z' end='2009-02-03T23:59Z' timezone='UTC' freq_timeunit='DAY' end_of_duration='NONE' instance-number=\"1\" action-nominal-time=\"2009-02-01T01:00Z\">";
actionXml += "<controls>";
actionXml += "<timeout>10</timeout>";
actionXml += "<concurrency>2</concurrency>";
actionXml += "<execution>LIFO</execution>";
actionXml += "</controls>";
actionXml += "<input-events>";
actionXml += "<data-in name='A' dataset='a'>";
actionXml += "<dataset name='a' frequency='7' initial-instance='2009-02-01T01:00Z' timezone='UTC' freq_timeunit='DAY' end_of_duration='NONE'>";
actionXml += "<uri-template>file://" + baseURI + "/workflows/${YEAR}/${DAY}</uri-template>";
actionXml += "</dataset>";
actionXml += "<instance>${coord:latest(0)}</instance>";
actionXml += "</data-in>";
actionXml += "</input-events>";
actionXml += "<output-events>";
actionXml += "<data-out name='LOCAL_A' dataset='local_a'>";
actionXml += "<dataset name='local_a' frequency='7' initial-instance='2009-02-01T01:00Z' timezone='UTC' freq_timeunit='DAY' end_of_duration='NONE'>";
actionXml += "<uri-template>file://" + baseURI + "/${YEAR}/${DAY}</uri-template>";
actionXml += "</dataset>";
actionXml += "<instance>${coord:current(-1)}</instance>";
actionXml += "</data-out>";
actionXml += "</output-events>";
actionXml += "<action>";
actionXml += "<workflow>";
actionXml += "<app-path>file://" + appPath + "</app-path>";
actionXml += "<configuration>";
actionXml += "<property>";
actionXml += "<name>inputA</name>";
actionXml += "<value>file://" + baseURI + "/US/2009/02/01</value>";
actionXml += "</property>";
actionXml += "<property>";
actionXml += "<name>inputB</name>";
actionXml += "<value>file://" + baseURI + "/US/2009/02/01</value>";
actionXml += "</property>";
actionXml += "</configuration>";
actionXml += "</workflow>";
actionXml += "</action>";
actionXml += "</coordinator-app>";
action.setActionXml(actionXml);
String createdConf = "<configuration> ";
createdConf += "<property> <name>execution_order</name> <value>LIFO</value> </property>";
createdConf += "<property> <name>user.name</name> <value>" + getTestUser() + "</value> </property>";
createdConf += "<property> <name>group.name</name> <value>other</value> </property>";
createdConf += "<property> <name>app-path</name> " + "<value>file://" + appPath + "</value> </property>";
createdConf += "<property> <name>jobTracker</name> ";
createdConf += "<value>localhost:9001</value></property>";
createdConf += "<property> <name>nameNode</name> <value>hdfs://localhost:9000</value></property>";
createdConf += "<property> <name>queueName</name> <value>default</value></property>";
createdConf += "</configuration> ";
XConfiguration conf = new XConfiguration(new StringReader(createdConf));
createdConf = conf.toXmlString(false);
action.setCreatedConf(createdConf);
store.insertCoordinatorAction(action);
String content = "<workflow-app xmlns='uri:oozie:workflow:0.1' xmlns:sla='uri:oozie:sla:0.1' name='no-op-wf'>";
content += "<start to='end' />";
content += "<end name='end' /></workflow-app>";
writeToFile(content, baseDir + "/no-op/");