List<CoordinatorJob> applicableCoords = getApplicableCoords(entity,
client, start, end, bundles);
List<CoordinatorAction> actions = new ArrayList<CoordinatorAction>();
for (CoordinatorJob coord : applicableCoords) {
Frequency freq = createFrequency(coord.getFrequency(),
coord.getTimeUnit());
TimeZone tz = EntityUtil.getTimeZone(coord.getTimeZone());
Date iterStart = EntityUtil.getNextStartTime(
coord.getStartTime(), freq, tz, start);
final Date iterEnd = (coord.getNextMaterializedTime().before(end) ? coord.getNextMaterializedTime() : end);
while (!iterStart.after(iterEnd)) {
int sequence = EntityUtil.getInstanceSequence(
coord.getStartTime(), freq, tz, iterStart);
String actionId = coord.getId() + "@" + sequence;
CoordinatorAction coordActionInfo = null;
try {
coordActionInfo = client.getCoordActionInfo(actionId);
} catch (OozieClientException e) {
LOG.debug("Unable to get action for " + actionId + " "
+ e.getMessage());
}
if (coordActionInfo != null) {
actions.add(coordActionInfo);
}
Calendar startCal = Calendar.getInstance(EntityUtil
.getTimeZone(coord.getTimeZone()));
startCal.setTime(iterStart);
startCal.add(freq.getTimeUnit().getCalendarUnit(),
coord.getFrequency());
iterStart = startCal.getTime();
}
}
actionsMap.put(cluster, actions);