Project

General

Profile

« Previous | Next » 

Revision 48800

more logging in the oozie job monitor procedure that tries to fetch the job report. More java8 refactorings

View differences:

OozieJobMonitor.java
64 64
			if (status == Status.SUCCEEDED) {
65 65
				// TODO set some content to return to the blackboard msg.
66 66

  
67
				log.info(String.format("start looking for oozie job(%s) output values: %s", getHadoopId(), workflowActions));
67 68
				final Properties report = getReport(getOozieClient(), getHadoopId(), workflowActions);
68 69
				if (report != null) {
69 70
					final Map<String, String> map = Maps.newHashMap();
70 71
					report.forEach((k, v) -> map.put(k.toString(), v.toString()));
72
					log.info("found oozie job report, size: " + map.size());
71 73
					getCallback().done(map);
72 74
				} else {
75
					log.warn("cannot find oozie job report!");
73 76
					getCallback().done(new HashMap<>());
74 77
				}
75 78
            } else {
......
89 92
	private static Properties getReport(final OozieClient oozieClient, final String oozieJobId, final Set<String> workflowActions) throws OozieClientException, IOException {
90 93
		WorkflowJob oozieJob = oozieClient.getJobInfo(oozieJobId);
91 94
		for (WorkflowAction currentAction : oozieJob.getActions()) {
92
			log.debug(String.format("looking for workflo actions to report, current: '%s'", currentAction.getName()));
95
			log.info(String.format("looking for workflow actions to report, current: '%s'", currentAction.getName()));
93 96
			if (workflowActions.contains(currentAction.getName())) {
97
				log.info(String.format("found workflow action %s", currentAction.getName()));
94 98
				if (ACTION_TYPE_SUBWORKFLOW.equals(currentAction.getType())) {
99
					log.info(String.format("looking for sub-workflow actions external id: %s", currentAction.getExternalId()));
95 100
					Properties subworkflowProperties = getReport(oozieClient, currentAction.getExternalId(), workflowActions);
96 101
					if (subworkflowProperties != null) {
97 102
						return subworkflowProperties;
......
99 104
				} else if (StringUtils.isNotBlank(currentAction.getData())) {
100 105
					Properties properties = new Properties();
101 106
					properties.load(IOUtils.toInputStream(currentAction.getData()));
107
					log.info(String.format("found workflow action(%s) properties size %s", currentAction.getName(), properties.values().size()));
102 108
					return properties;
103 109
				}
110
			} else {
111
				log.info(String.format("cannot find workflow action(%s) properties", currentAction.getName()));
104 112
			}
105 113
		}
106

  
107 114
		return null;
108 115
	}
109 116

  

Also available in: Unified diff