@Override protected String getActualExternalId(WorkflowAction action) { String launcherJobId = action.getExternalId(); String childId = action.getExternalChildIDs(); if (childId != null && !childId.isEmpty()) { return childId; } else { return launcherJobId; } }
@Override protected String getActualExternalId(WorkflowAction action) { String launcherJobId = action.getExternalId(); String childId = action.getExternalChildIDs(); if (childId != null && !childId.isEmpty()) { return childId; } else { return launcherJobId; } }
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(""); } } }
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(""); } } }
@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); }
void killExternalChildApp(WorkflowAction action, YarnClient yarnClient, String appExternalId) throws YarnException, IOException { String externalChildIDs = action.getExternalChildIDs(); if (externalChildIDs != null) { for (String childId : externalChildIDs.split(",")) { ApplicationId appChildId = ConverterUtils.toApplicationId(childId.trim()); if (finalAppStatusUndefined(yarnClient.getApplicationReport(appChildId))) { try { LOG.info("Killing action {0}''s external child application {1}", action.getId(), childId); yarnClient.killApplication(appChildId); } catch (Exception e) { LOG.warn("Could not kill external child of {0}, {1}", appExternalId, childId, e); } } } } }
@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); }
void killExternalChildApp(WorkflowAction action, YarnClient yarnClient, String appExternalId) throws YarnException, IOException { String externalChildIDs = action.getExternalChildIDs(); if (externalChildIDs != null) { for (String childId : externalChildIDs.split(",")) { ApplicationId appChildId = ConverterUtils.toApplicationId(childId.trim()); if (finalAppStatusUndefined(yarnClient.getApplicationReport(appChildId))) { try { LOG.info("Killing action {0}''s external child application {1}", action.getId(), childId); yarnClient.killApplication(appChildId); } catch (Exception e) { LOG.warn("Could not kill external child of {0}, {1}", appExternalId, childId, e); } } } } }
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()); }
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());
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());
String externalIds = action.getExternalChildIDs(); if (externalIds != null && !externalIds.trim().isEmpty()) { String []jobIds = externalIds.split(",");
String externalIds = action.getExternalChildIDs(); if (externalIds != null && !externalIds.trim().isEmpty()) { String []jobIds = externalIds.split(",");
String externalIds = wfAction.getExternalChildIDs(); assertNotNull(externalIds); assertNotSame("", externalIds);
.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());
.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());
.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())