Permalink
Browse files

removed restriction of partition expression for target cluster

  • Loading branch information...
1 parent 52c7fe4 commit 8af69c9ce02b123177bb3332905eef68f3f78677 Shwetha GS committed Nov 7, 2012
@@ -243,15 +243,10 @@ private void validateFeedPartitionExpression(Feed feed) throws IvoryException {
"clusters is more than the number of partitions defined in feed");
}
}
-
- if(numTrgClusters > 1 && numSourceClusters >= 1) {
- String part = FeedHelper.normalizePartitionExpression(cluster.getPartition());
- if(StringUtils.split(part, '/').length == 0)
- throw new ValidationException("Partition expression has to be specified for cluster " + cluster.getName() +
- " as there are more than one target clusters");
- validateClusterExpDefined(cluster);
+
+ if (numTrgClusters > 1 && numSourceClusters >= 1) {
+ validateClusterExpDefined(cluster);
}
-
}
}
}
@@ -1036,9 +1036,17 @@ public String getWorkflowStatus(String cluster, String jobId)
throws IvoryException {
OozieClient client = OozieClientFactory.get(cluster);
try {
- WorkflowJob jobInfo = client.getJobInfo(jobId);
- Status status = jobInfo.getStatus();
- return status.name();
+ if(jobId.endsWith("-W")) {
+ WorkflowJob jobInfo = client.getJobInfo(jobId);
+ return jobInfo.getStatus().name();
+ } else if(jobId.endsWith("-C")) {
+ CoordinatorJob coord = client.getCoordJobInfo(jobId);
+ return coord.getStatus().name();
+ } else if(jobId.endsWith("-B")) {
+ BundleJob bundle = client.getBundleJobInfo(jobId);
+ return bundle.getStatus().name();
+ }
+ throw new IllegalArgumentException("Unhandled jobs id: " + jobId);
} catch (Exception e) {
LOG.error("Unable to get status of workflows", e);
throw new IvoryException(e);

0 comments on commit 8af69c9

Please sign in to comment.