use of org.apache.oozie.coord.input.dependency.CoordInputDependency in project oozie by apache.
the class CoordActionUpdatePushMissingDependency method execute.
@Override
protected Void execute() throws CommandException {
CoordInputDependency coordPushInputDependency = coordAction.getPushInputDependencies();
CoordInputDependency coordPullInputDependency = coordAction.getPullInputDependencies();
LOG.info("STARTED for Action id [{0}]", actionId);
if (coordPushInputDependency.isDependencyMet()) {
LOG.info("Nothing to check. Empty push missing dependency");
} else {
PartitionDependencyManagerService pdms = Services.get().get(PartitionDependencyManagerService.class);
Collection<String> availDepList = pdms.getAvailableDependencyURIs(actionId);
if (availDepList == null || availDepList.size() == 0) {
LOG.info("There are no available dependencies");
if (isTimeout()) {
// Poll and check as one last try
queue(new CoordPushDependencyCheckXCommand(coordAction.getId()), 100);
}
} else {
String pushMissingDependencies = coordPushInputDependency.getMissingDependencies().toString();
LOG.debug("Updating with available uris = [{0}] where missing uris = [{1}]", pushMissingDependencies);
String[] missingDependenciesArray = DependencyChecker.dependenciesAsArray(pushMissingDependencies);
coordPushInputDependency.addToAvailableDependencies(availDepList);
boolean isChangeInDependency = true;
if (coordPushInputDependency.isDependencyMet()) {
// All push-based dependencies are available
onAllPushDependenciesAvailable(coordPullInputDependency.isDependencyMet());
} else {
if (coordPushInputDependency.getMissingDependenciesAsList().size() == missingDependenciesArray.length) {
isChangeInDependency = false;
}
if (isTimeout()) {
// Poll and check as one last try
queue(new CoordPushDependencyCheckXCommand(coordAction.getId()), 100);
}
}
updateCoordAction(coordAction, isChangeInDependency);
removeAvailableDependencies(pdms, availDepList);
LOG.info("ENDED for Action id [{0}]", actionId);
}
}
return null;
}
Aggregations