- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.oozie.client.WorkflowAction.getData()
方法的一些代码示例,展示了WorkflowAction.getData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkflowAction.getData()
方法的具体详情如下:
包路径:org.apache.oozie.client.WorkflowAction
类名称:WorkflowAction
方法名:getData
[英]Return the action data.
[中]返回动作数据。
代码示例来源:origin: apache/oozie
/**
* Test if a shell script could run successfully with {@link ShellMain#CONF_OOZIE_SHELL_SETUP_HADOOP_CONF_DIR} enabled.
* Run with {@link ShellMain#CONF_OOZIE_SHELL_SETUP_HADOOP_CONF_DIR_WRITE_LOG4J_PROPERTIES} disabled.
*
* @throws Exception
*/
public void testShellScriptHadoopConfDirWithNoL4J() throws Exception {
FileSystem fs = getFileSystem();
// Create the script file with canned shell command
Path script = new Path(getAppPath(), SHELL_SCRIPTNAME);
Writer w = new OutputStreamWriter(fs.create(script));
w.write(SHELL_SCRIPT_LOG4J_EXISTENCE_CHECKER);
w.close();
// Create sample Shell action xml
String actionXml = "<shell>" + "<job-tracker>" + getJobTrackerUri() + "</job-tracker>" + "<name-node>"
+ getNameNodeUri() + "</name-node>" + "<configuration>"
+ "<property><name>oozie.action.shell.setup.hadoop.conf.dir</name><value>true</value></property>"
+ "<property><name>oozie.action.shell.setup.hadoop.conf.dir.write.log4j.properties"
+ "</name><value>false</value></property>"
+ "</configuration>" + "<exec>" + SHELL_EXEC + "</exec>" + "<argument>" + SHELL_PARAM + "</argument>"
+ "<argument>" + SHELL_SCRIPTNAME + "</argument>" + "<file>" + script.toString()
+ "#" + script.getName() + "</file>" + "<capture-output/>" + "</shell>";
// Submit and verify the job's status
WorkflowAction action = _testSubmit(actionXml, true, "");
String log4jExists = PropertiesUtils.stringToProperties(action.getData()).getProperty("L4J_EXISTS");
Assert.assertNull(
"Expected no log4j.properties file to exist", log4jExists);
}
代码示例来源:origin: apache/oozie
public void testProperties() {
WorkflowAction action = createNode();
Assert.assertEquals("a", action.getId());
Assert.assertEquals("b", action.getName());
Assert.assertEquals("c", action.getType());
Assert.assertEquals("d", action.getConf());
Assert.assertEquals(WorkflowAction.Status.RUNNING, action.getStatus());
Assert.assertEquals(1, action.getRetries());
Assert.assertEquals(JsonUtils.parseDateRfc822(START_TIME), action.getStartTime());
Assert.assertEquals(JsonUtils.parseDateRfc822(END_TIME), action.getEndTime());
Assert.assertEquals("e", action.getTransition());
Assert.assertEquals("ee", action.getData());
Assert.assertEquals("stats", action.getStats());
Assert.assertEquals("extChIDs", action.getExternalChildIDs());
Assert.assertEquals("f", action.getExternalId());
Assert.assertEquals("g", action.getExternalStatus());
Assert.assertEquals("h", action.getTrackerUri());
Assert.assertEquals("i", action.getConsoleUrl());
Assert.assertEquals("j", action.getErrorCode());
Assert.assertEquals("k", action.getErrorMessage());
}
代码示例来源:origin: apache/oozie
public void testOutputSubmitOK() throws Exception {
String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"<arg>out</arg>" +
"<capture-output/>" +
"</java>";
Context context = createContext(actionXml, null);
final String runningJob = submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(runningJob);
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertEquals("SUCCEEDED", context.getAction().getExternalStatus());
assertNotNull(context.getAction().getData());
StringReader sr = new StringReader(context.getAction().getData());
Properties props = new Properties();
props.load(sr);
assertEquals("A", props.get("a"));
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.OK, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
assertEquals(envValueHavingEqualSign, PropertiesUtils.stringToProperties(action.getData())
.getProperty("var2"));
代码示例来源:origin: apache/oozie
public void testAdditionalJarSubmitOK() throws Exception {
Path appJarPath = new Path("test-extra.jar");
File jarFile = IOUtils.createJar(new File(getTestCaseDir()), appJarPath.getName(), LauncherMainTester2.class);
InputStream is = new FileInputStream(jarFile);
OutputStream os = getFileSystem().create(new Path(getAppPath(), appJarPath.toString()));
IOUtils.copyStream(is, os);
String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<main-class>" + LauncherMainTester2.class.getName() + "</main-class>" +
"<file>" + appJarPath.toString() + "</file>" +
"</java>";
Context context = createContext(actionXml, null);
final String runningJobId = submitAction(context);
ActionExecutor ae = new JavaActionExecutor();
assertFalse(ae.isCompleted(context.getAction().getExternalStatus()));
waitUntilYarnAppDoneAndAssertSuccess(runningJobId);
ae.check(context, context.getAction());
assertEquals("SUCCEEDED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.OK, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
ae.check(context, context.getAction());
assertEquals("SUCCEEDED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
代码示例来源:origin: apache/oozie
action.getExternalStatus());
if (action.getData() != null) {
workflowInstance
.setVar(action.getName() + WorkflowInstance.NODE_VAR_SEPARATOR + ACTION_DATA, action.getData());
代码示例来源:origin: apache/oozie
public void testSimpestSleSubmitOK() throws Exception {
String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"</java>";
Context context = createContext(actionXml, null);
submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(context.getAction().getExternalId());
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertEquals("SUCCEEDED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.OK, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
public void testSimplestSubmitWithResourceManagerOK() throws Exception {
final String actionXml = "<java>" +
"<resource-manager>" + getJobTrackerUri() + "</resource-manager>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"</java>";
final Context context = createContext(actionXml, null);
submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(context.getAction().getExternalId());
final ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertEquals("SUCCEEDED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.OK, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
public void testSubmitOKWithLauncherJavaOpts() throws Exception {
String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<configuration>" +
" <property><name>oozie.launcher.javaopts</name><value>-DtestJavaOpts=true</value></property>" +
"</configuration>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"</java>";
Context context = createContext(actionXml, null);
submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(context.getAction().getExternalId());
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertEquals("FAILED/KILLED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.ERROR, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
public void testSubmitOKWithLauncherEnvVars() throws Exception {
String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<configuration>" +
" <property><name>oozie.launcher.env</name><value>A=foo1" + File.pathSeparator + "B=foo2</value></property>" +
"</configuration>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"</java>";
Context context = createContext(actionXml, null);
submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(context.getAction().getExternalId());
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertEquals("SUCCEEDED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.OK, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
public void testSubmitOKWithLauncherJavaOptsExhaustingHeap() throws Exception {
final String actionXml = "<java>" +
" <job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
" <name-node>" + getNameNodeUri() + "</name-node>" +
" <configuration>" +
" <property>" +
" <name>oozie.launcher.javaopts</name>" +
" <value>-Xms512m -Xmx1536m -XX:-DisableExplicitGC</value>" +
" </property>" +
" </configuration>" +
" <main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
" <arg>-Xmx3072m</arg>" +
"</java>";
final Context context = createContext(actionXml, null);
submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(context.getAction().getExternalId());
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertEquals("FAILED/KILLED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.ERROR, context.getAction().getStatus());
assertTrue("error message should contain: \"Java heap space\"",
context.getAction().getErrorMessage().contains("Java heap space"));
}
}
代码示例来源:origin: apache/oozie
public void testEnvVarsPropagatedFromLauncherConfig() throws Exception {
String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<configuration>" +
" <property><name>oozie.launcher.env</name><value>LAUNCHER_ENVIRON=foo1" + File.pathSeparator +
"B=foo2</value></property>" +
"</configuration>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"</java>";
Context context = createContext(actionXml, null);
submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(context.getAction().getExternalId());
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertEquals("FAILED/KILLED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.ERROR, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
public void testSubmitOKWithVcoresAndMemory() throws Exception {
String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<configuration>" +
" <property><name>oozie.launcher.vcores</name><value>1</value></property>" +
" <property><name>oozie.launcher.memory.mb</name><value>1024</value></property>" +
"</configuration>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"</java>";
Context context = createContext(actionXml, null);
submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(context.getAction().getExternalId());
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertEquals("SUCCEEDED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.OK, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
public void testExceptionSubmitException() throws Exception {
String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"<arg>exception</arg>" +
"</java>";
Context context = createContext(actionXml, null);
final String runningJob = submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(runningJob);
//FIXME assertFalse(LauncherHelper.isMainSuccessful(runningJob));
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertTrue(ae.isCompleted(context.getAction().getExternalStatus()));
assertEquals("FAILED/KILLED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.ERROR, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
public void testExit0SubmitOK() throws Exception {
String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"<arg>exit0</arg>" +
"</java>";
Context context = createContext(actionXml, null);
final String runningJob = submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(runningJob);
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertTrue(ae.isCompleted(context.getAction().getExternalStatus()));
assertEquals("SUCCEEDED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.OK, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
public void testExceptionSubmitThrowable() throws Exception {
String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"<arg>throwable</arg>" +
"</java>";
Context context = createContext(actionXml, null);
final String runningJob = submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(runningJob);
//FIXME assertFalse(LauncherHelper.isMainSuccessful(runningJob));
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertTrue(ae.isCompleted(context.getAction().getExternalStatus()));
assertEquals("FAILED/KILLED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.ERROR, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
public void testExit1SubmitError() throws Exception {
String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"<arg>exit1</arg>" +
"</java>";
Context context = createContext(actionXml, null);
final String runningJob = submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(runningJob);
//FIXME assertFalse(LauncherHelper.isMainSuccessful(runningJob));
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertTrue(ae.isCompleted(context.getAction().getExternalStatus()));
assertEquals("FAILED/KILLED", context.getAction().getExternalStatus());
assertEquals("1", context.getAction().getErrorCode());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.ERROR, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
private void testEmptyArgs(boolean nullArgsAllowed, String expectedExternalStatus, WorkflowAction.Status expectedStatus)
throws Exception {
ConfigurationService.setBoolean(LauncherAMUtils.CONF_OOZIE_NULL_ARGS_ALLOWED, nullArgsAllowed);
String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"<arg></arg>" +
"</java>";
Context context = createContext(actionXml, null);
submitAction(context);
waitUntilYarnAppDoneAndAssertSuccess(context.getAction().getExternalId());
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertTrue(ae.isCompleted(context.getAction().getExternalStatus()));
assertEquals(expectedExternalStatus, context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(expectedStatus, context.getAction().getStatus());
}
代码示例来源:origin: apache/oozie
public void testRecovery() throws Exception {
final String actionXml = "<java>" +
"<job-tracker>" + getJobTrackerUri() + "</job-tracker>" +
"<name-node>" + getNameNodeUri() + "</name-node>" +
"<main-class>" + LauncherMainTester.class.getName() + "</main-class>" +
"</java>";
final Context context = createContext(actionXml, null);
String launcherId = submitAction(context);
waitFor(60 * 1000, new Predicate() {
@Override
public boolean evaluate() throws Exception {
JavaActionExecutor ae = new JavaActionExecutor();
Configuration conf = ae.createBaseHadoopConf(context, XmlUtils.parseXml(actionXml));
return LauncherHelper.getRecoveryId(conf, context.getActionDir(), context.getRecoveryId()) != null;
}
});
final String runningJob2 = submitAction(context);
assertEquals(launcherId, runningJob2);
assertEquals(launcherId, context.getAction().getExternalId());
waitUntilYarnAppDoneAndAssertSuccess(launcherId);
ActionExecutor ae = new JavaActionExecutor();
ae.check(context, context.getAction());
assertEquals("SUCCEEDED", context.getAction().getExternalStatus());
assertNull(context.getAction().getData());
ae.end(context, context.getAction());
assertEquals(WorkflowAction.Status.OK, context.getAction().getStatus());
}
本文整理了Java中org.apache.oozie.client.WorkflowAction.getExternalStatus()方法的一些代码示例,展示了WorkflowAction.getE
本文整理了Java中org.apache.oozie.client.WorkflowAction.getData()方法的一些代码示例,展示了WorkflowAction.getData()的具体用法
本文整理了Java中org.apache.oozie.client.WorkflowAction.getConf()方法的一些代码示例,展示了WorkflowAction.getConf()的具体用法
本文整理了Java中org.apache.oozie.client.WorkflowAction.getUserRetryCount()方法的一些代码示例,展示了WorkflowAction.getU
本文整理了Java中org.apache.oozie.client.WorkflowAction.getTransition()方法的一些代码示例,展示了WorkflowAction.getTrans
本文整理了Java中org.apache.oozie.client.WorkflowAction.getRetries()方法的一些代码示例,展示了WorkflowAction.getRetries(
本文整理了Java中org.apache.oozie.client.WorkflowAction.getExternalId()方法的一些代码示例,展示了WorkflowAction.getExter
本文整理了Java中org.apache.oozie.client.WorkflowAction.getExternalChildIDs()方法的一些代码示例,展示了WorkflowAction.ge
本文整理了Java中org.apache.oozie.client.WorkflowAction.getTrackerUri()方法的一些代码示例,展示了WorkflowAction.getTrack
本文整理了Java中org.apache.oozie.client.WorkflowAction.getName()方法的一些代码示例,展示了WorkflowAction.getName()的具体用法
本文整理了Java中org.apache.oozie.client.WorkflowAction.getErrorCode()方法的一些代码示例,展示了WorkflowAction.getErrorC
本文整理了Java中org.apache.oozie.client.WorkflowAction.getConsoleUrl()方法的一些代码示例,展示了WorkflowAction.getConso
本文整理了Java中org.apache.oozie.client.WorkflowAction.getEndTime()方法的一些代码示例,展示了WorkflowAction.getEndTime(
本文整理了Java中org.apache.oozie.client.WorkflowAction.getType()方法的一些代码示例,展示了WorkflowAction.getType()的具体用法
本文整理了Java中org.apache.oozie.client.WorkflowAction.getId()方法的一些代码示例,展示了WorkflowAction.getId()的具体用法。这些代
本文整理了Java中org.apache.oozie.client.WorkflowAction.getStartTime()方法的一些代码示例,展示了WorkflowAction.getStartT
本文整理了Java中org.apache.oozie.client.WorkflowAction.getErrorMessage()方法的一些代码示例,展示了WorkflowAction.getErr
本文整理了Java中org.apache.oozie.client.WorkflowAction.getStatus()方法的一些代码示例,展示了WorkflowAction.getStatus()的
本文整理了Java中org.apache.oozie.client.WorkflowAction.getStats()方法的一些代码示例,展示了WorkflowAction.getStats()的具体
我是一名优秀的程序员,十分优秀!