- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.oozie.client.WorkflowAction
类的一些代码示例,展示了WorkflowAction
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkflowAction
类的具体详情如下:
包路径:org.apache.oozie.client.WorkflowAction
类名称:WorkflowAction
[英]Bean that represents a workflow action in a workflow job.
[中]表示工作流作业中的工作流操作的Bean。
代码示例来源:origin: YahooArchive/oozie
private void printWorkflowAction(WorkflowAction action, boolean contains) {
System.out.println("ID : " + maskIfNull(action.getId()));
System.out.println(RULER);
System.out.println("Console URL : " + maskIfNull(action.getConsoleUrl()));
System.out.println("Error Code : " + maskIfNull(action.getErrorCode()));
System.out.println("Error Message : " + maskIfNull(action.getErrorMessage()));
System.out.println("External ID : " + maskIfNull(action.getExternalId()));
System.out.println("External Status : " + maskIfNull(action.getExternalStatus()));
System.out.println("Name : " + maskIfNull(action.getName()));
System.out.println("Retries : " + action.getRetries());
System.out.println("Tracker URI : " + maskIfNull(action.getTrackerUri()));
System.out.println("Type : " + maskIfNull(action.getType()));
System.out.println("Started : " + maskDate(action.getStartTime(), contains));
System.out.println("Status : " + action.getStatus());
System.out.println("Ended : " + maskDate(action.getEndTime(), contains));
System.out.println(RULER);
}
代码示例来源:origin: apache/oozie
@Override
protected String getActualExternalId(WorkflowAction action) {
String launcherJobId = action.getExternalId();
String childId = action.getExternalChildIDs();
if (childId != null && !childId.isEmpty()) {
return childId;
} else {
return launcherJobId;
}
}
代码示例来源:origin: apache/oozie
public static String getActionYarnTag(Configuration conf, String parentId, WorkflowAction wfAction) {
String tag;
if ( conf != null && conf.get(OOZIE_ACTION_YARN_TAG) != null) {
tag = conf.get(OOZIE_ACTION_YARN_TAG) + "@" + wfAction.getName();
} else if (parentId != null) {
tag = parentId + "@" + wfAction.getName();
} else {
tag = wfAction.getId();
}
return tag;
}
代码示例来源:origin: org.apache.oozie/oozie-tools
private void persistResolvedActionDefinition(final WorkflowAction action, final File resolvedActionsDir) throws IOException {
persistWorkflowDefinition(resolvedActionsDir, action.getName(), action.getConf());
}
代码示例来源:origin: apache/oozie
@VisibleForTesting
void printWorkflowAction(WorkflowAction action, String timeZoneId, boolean verbose) {
System.out.println("ID : " + maskIfNull(action.getId()));
System.out.println(RULER);
System.out.println("Console URL : " + maskIfNull(action.getConsoleUrl()));
System.out.println("Error Code : " + maskIfNull(action.getErrorCode()));
System.out.println("Error Message : " + maskIfNull(action.getErrorMessage()));
System.out.println("External ID : " + maskIfNull(action.getExternalId()));
System.out.println("External Status : " + maskIfNull(action.getExternalStatus()));
System.out.println("Name : " + maskIfNull(action.getName()));
System.out.println("Retries : " + action.getUserRetryCount());
System.out.println("Tracker URI : " + maskIfNull(action.getTrackerUri()));
System.out.println("Type : " + maskIfNull(action.getType()));
System.out.println("Started : " + maskDate(action.getStartTime(), timeZoneId, verbose));
System.out.println("Status : " + action.getStatus());
System.out.println("Ended : " + maskDate(action.getEndTime(), timeZoneId, verbose));
if (verbose) {
System.out.println("External Stats : " + action.getStats());
System.out.println("External ChildIDs : " + action.getExternalChildIDs());
}
System.out.println(RULER);
}
代码示例来源: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: org.apache.oozie/oozie-tools
for (int actionCount = 0; actionCount != workflowActions.size() && actionCount < maxChildActions; ++actionCount) {
final WorkflowAction action = workflowActions.get(actionCount);
bundleEntryWriter.writeStringValue("Action Id : ", action.getId())
.writeStringValue("Name : ", action.getName())
.writeStringValue("Type : ", action.getType())
.writeStringValue("Status : ", action.getStatus().toString())
.writeStringValue("Transition : ", action.getTransition())
.writeDateValue("Start Time : ", action.getStartTime())
.writeDateValue("End Time : ", action.getEndTime())
.writeStringValue("Error Code : ", action.getErrorCode())
.writeStringValue("Error Message : ", action.getErrorMessage())
.writeStringValue("Console URL : ", action.getConsoleUrl())
.writeStringValue("Tracker URI : ", action.getTrackerUri())
.writeStringValue("External Child Ids : ", action.getExternalChildIDs())
.writeStringValue("External Id : ", action.getExternalId())
.writeStringValue("External Status : ", action.getExternalStatus())
.writeStringValue("Data : ", action.getData())
.writeStringValue("Stats : ", action.getStats())
.writeStringValue("Credentials : ", action.getCred())
.writeIntValue("Retries : ", action.getRetries())
.writeIntValue("User Retry Int : ", action.getUserRetryInterval())
.writeIntValue("User Retry Count : ", action.getUserRetryCount())
.writeIntValue("User Retry Max : ", action.getUserRetryMax())
.writeNewLine()
.flush();
final String actionType = action.getType();
persistResolvedActionDefinition(action, resolvedActionsDir);
代码示例来源: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 static void setActionInfo(WorkflowInstance workflowInstance, WorkflowAction action) {
if (action.getExternalId() != null) {
workflowInstance.setVar(action.getName() + WorkflowInstance.NODE_VAR_SEPARATOR + ACTION_EXTERNAL_ID,
action.getExternalId());
if (action.getTrackerUri() != null) {
workflowInstance.setVar(action.getName() + WorkflowInstance.NODE_VAR_SEPARATOR + ACTION_TRACKER_URI,
action.getTrackerUri());
if (action.getExternalStatus() != null) {
workflowInstance.setVar(action.getName() + WorkflowInstance.NODE_VAR_SEPARATOR + ACTION_EXTERNAL_STATUS,
action.getExternalStatus());
if (action.getData() != null) {
workflowInstance
.setVar(action.getName() + WorkflowInstance.NODE_VAR_SEPARATOR + ACTION_DATA, action.getData());
if (action.getExternalChildIDs() != null) {
workflowInstance.setVar(action.getName() + WorkflowInstance.NODE_VAR_SEPARATOR + ACTION_DATA,
HADOOP_JOBS_PREFIX + action.getExternalChildIDs());
if (action.getStats() != null) {
workflowInstance.setVar(action.getName() + WorkflowInstance.NODE_VAR_SEPARATOR
+ MapReduceActionExecutor.HADOOP_COUNTERS,
action.getStats());
if (action.getErrorCode() != null) {
workflowInstance.setVar(action.getName() + WorkflowInstance.NODE_VAR_SEPARATOR + ACTION_ERROR_CODE,
action.getErrorCode());
代码示例来源:origin: jaibeermalik/searchanalytics-bigdata
workflowAction.getConsoleUrl());
LOG.debug("HiveActionWorkflowJob Action Name: {}",
workflowAction.getName());
LOG.debug("HiveActionWorkflowJob Action error message: {}",
workflowAction.getErrorMessage());
LOG.debug("HiveActionWorkflowJob Action Status: {}",
workflowAction.getStats());
LOG.debug("HiveActionWorkflowJob Action data: {}",
workflowAction.getData());
LOG.debug("HiveActionWorkflowJob Action conf: {}",
workflowAction.getConf());
LOG.debug("HiveActionWorkflowJob Action retries: {}",
workflowAction.getRetries());
LOG.debug("HiveActionWorkflowJob Action id: {}",
workflowAction.getId());
LOG.debug("HiveActionWorkflowJob Action start time: {}",
workflowAction.getStartTime());
LOG.debug("HiveActionWorkflowJob Action end time: {}",
workflowAction.getEndTime());
LOG.debug("HiveActionWorkflowJob Oozie Url: {}",
client.getOozieUrl());
代码示例来源: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: com.yahoo.oozie/oozie-examples
private static void printWorkflowInfo(WorkflowJob wf) {
System.out.println("Application Path : " + wf.getAppPath());
System.out.println("Application Name : " + wf.getAppName());
System.out.println("Application Status : " + wf.getStatus());
System.out.println("Application Actions:");
for (WorkflowAction action : wf.getActions()) {
System.out.println(MessageFormat.format(" Name: {0} Type: {1} Status: {2}", action.getName(),
action.getType(), action.getStatus()));
}
System.out.println();
}
代码示例来源:origin: apache/oozie
protected String submitAction(Context context, JavaActionExecutor javaActionExecutor) throws ActionExecutorException {
WorkflowAction action = context.getAction();
javaActionExecutor.prepareActionDir(getFileSystem(), context);
javaActionExecutor.submitLauncher(getFileSystem(), context, action);
String jobId = action.getExternalId();
String jobTracker = action.getTrackerUri();
String consoleUrl = action.getConsoleUrl();
assertNotNull(jobId);
assertNotNull(jobTracker);
assertNotNull(consoleUrl);
return jobId;
}
代码示例来源:origin: apache/oozie
private Map<String, WorkflowAction> fillWorkflowActions() {
final Map<String, WorkflowAction> workflowActions = new LinkedHashMap<>();
boolean found = false;
for (final WorkflowAction wfAction : job.getActions()) {
workflowActions.put(wfAction.getName(), wfAction);
if (!found) {
switch (wfAction.getStatus()) {
case KILLED:
case ERROR:
case FAILED:
showKill = true; // Assuming on error the workflow eventually ends with kill node
found = true;
break;
default:
// Look further
break;
}
}
}
return workflowActions;
}
代码示例来源:origin: apache/oozie
/**
* Kill ssh action.
*
* @param context action execution context.
* @param action object.
* @throws org.apache.oozie.action.ActionExecutorException
*/
@Override
public void kill(Context context, WorkflowAction action) throws ActionExecutorException {
LOG.info("Killing action");
String command = "ssh " + action.getTrackerUri() + " kill -KILL " + action.getExternalId();
int returnValue = getReturnValue(command);
if (returnValue != 0) {
throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FAILED_TO_KILL", XLog.format(
"Unable to kill process {0} on {1}", action.getExternalId(), action.getTrackerUri()));
}
context.setEndData(WorkflowAction.Status.KILLED, "ERROR");
}
代码示例来源:origin: apache/oozie
private void swapMRActionID(WorkflowAction waBean) {
if (waBean.getType().equals("map-reduce")) {
String childId = waBean.getExternalChildIDs();
if (childId != null && !childId.equals("")) {
String consoleBase = getConsoleBase(waBean.getConsoleUrl());
((WorkflowActionBean) waBean).setConsoleUrl(consoleBase + childId);
((WorkflowActionBean) waBean).setExternalId(childId);
((WorkflowActionBean) waBean).setExternalChildIDs("");
}
}
}
代码示例来源:origin: apache/oozie
boolean exception = false;
try {
if (action.getStatus() == WorkflowAction.Status.OK) {
Element actionXml = XmlUtils.parseXml(action.getConf());
Configuration jobConf = createBaseHadoopConf(context, actionXml);
jobClient = createJobClient(context, jobConf);
RunningJob runningJob = jobClient.getJob(JobID.forName(action.getExternalChildIDs()));
if (runningJob == null) {
throw new ActionExecutorException(ActionExecutorException.ErrorType.FAILED, "MR002",
"Unknown hadoop job [{0}] associated with action [{1}]. Failing this action!",
action.getExternalChildIDs(), action.getId());
context.setVar(HADOOP_COUNTERS, "");
XLog.getLog(getClass()).warn("Could not find Hadoop Counters for: [{0}]",
action.getExternalChildIDs());
代码示例来源: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 addActionInfo(StringBuffer sb) {
addJobInfo(sb, ACTION_NAME, action.getName());
addJobInfo(sb, ACTION_TYPE, action.getType());
}
代码示例来源:origin: apache/oozie
public static void setLogInfo(WorkflowAction action) {
String actionId = action.getId();
XLog.Info.get().setParameter(DagXLogInfoService.JOB, actionId.substring(0, actionId.indexOf("@")));
XLog.Info.get().setParameter(DagXLogInfoService.ACTION, actionId);
XLog.Info.get().resetPrefix();
}
我正在尝试将 Oozie 数据库从 derby 迁移到 MySql。一切都运行良好,除非我尝试运行命令 ./oozie-setup.sh prepare-war 出现以下错误 setting CA
当我在 oozie 的 job.properties 中更改协调员作业的开始时间时,该作业不会采用更改后的时间,而是在旧的计划时间运行。 旧的job.properties: startMinute=0
我已经尝试过 oozie job -oozie http://sandbox.hortonworks.com:11000/oozie -config ./job.properties -kill *
当我尝试终止或暂停时,我在用户“runner”下提交了 oozie 协调员作业,我收到以下错误消息: [runner@hadooptools ~]$ oozie job -oozie http
如何自动重新运行工作流中失败的任何操作? 我知道从命令行或彻底的色调手动重新运行的方法。 $oozie job -rerun ... 我们可以在工作流中设置或提供任何参数以在操作失败时自动重试吗? 最
我对 oozie 有点陌生。我在我的服务器上安装了(使用 cdh 存储库)oozie(我遵循了 CDH4 文档 [我的 hadoop 在 cdh4 中运行])。 我已使用以下信息更新我的 core-s
在 oozie 中,input-events 非常简单,如果指定的文件/文件夹不存在,协调器作业将保持在 WAITING 状态。但我无法理解 output-events 的作用。 根据我的理解,在 o
我有一个 java 操作已暂停 5 天,处于此状态,我不知道 oozie 要我做什么。有什么想法吗? 最佳答案 这意味着有一个错误。如果您配置了重试,则可能会多次重试。配置重试后,在第一个错误之后,作
我的要求是在任何工作流操作失败的情况下终止或停止启动工作流的协调器。 wf:id 给出工作流的 ID。 协调有没有这样的功能?? 如果没有,请提出将坐标传递给工作流的方法。 最佳答案 您可以在协调器中
在我的 oozie coordinator.xml 中,我不想指定结束时间。 有没有办法做到这一点。 coordinator.xml hdfs://l
我在 Oozie 3.3.2 上运行 oozie 工作流时出现以下错误 Error: E0732 : E0732: Fork /Join[join1]不是成对的(join 应该是 [join2]) 现
我是 Oozie 的新手,只是想知道 - 如何使用 Oozie 安排 sqoop 作业。我知道可以将 sqoop 操作添加为 Oozie 工作流程的一部分。但是我怎样才能安排一个 sqoop 操作并让
我正在尝试运行 sh通过 Oozie 编写脚本,但我面临一个问题: Cannot run program "script.sh" (in directory "/mapred/local/taskTr
我可以在 Oozie 移动操作中使用通配符(例如 *)或文件模式(例如 {})吗? 我正在尝试将我的工作结果移动到存档目录中。 目录结构状态: output - 201304 - 201305 a
请记住,我是 oozie 的完全新手。我知道可以使用 arg 标签在 oozie 工作流 xml 中指定命令行参数。我想知道如何指定一个可选的命令行参数,以便 oozie 不会提示如果用户没有指定缺少
我可以使用 Hue 创建一个不会过期(没有结束日期)的无限 Oozie 协调器吗? 请帮忙! 最佳答案 没有。您不能创建一个永不过期的协调器。这是 Oozie Coordinator xsd引用:
我是 Oozie 的新手,我正在尝试安装和设置 Oozie。我按照 Apache 站点上提供的说明进行操作:“http://oozie.apache.org/docs/3.3.2/DG_QuickSt
我想知道是否有一种方法可以在不重启 oozie 作业(协调器)的情况下重新加载 oozie 作业的配置文件。 因为协调器实际上运行着我们的许多任务,所以有时我们可能只需要更改作业配置文件的一行,然后进
任何人都可以建议哪个最适合 Hadoop 的调度程序。如果是奥兹。 oozie 与 cron 工作有何不同。 最佳答案 Oozie 是最好的选择。 Oozie Coordinator 允许在文件到达
我正在编写一个 oozie java 操作,它在作业 ./lib 文件夹中的 jar 文件中包含我的自定义代码。 我还想在我的工作外部的文件夹中添加一个 jar 到类路径中(即 /home/me/ot
我是一名优秀的程序员,十分优秀!