falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suh...@apache.org
Subject incubator-falcon git commit: FALCON-917. Fix corner cases while getting job id during instance status. Contributed by Suhas Vasu
Date Thu, 27 Nov 2014 09:34:37 GMT
Repository: incubator-falcon
Updated Branches:
  refs/heads/master 7f795ca4b -> bff951b2b


FALCON-917. Fix corner cases while getting job id during instance status. Contributed by Suhas
Vasu


Project: http://git-wip-us.apache.org/repos/asf/incubator-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-falcon/commit/bff951b2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-falcon/tree/bff951b2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-falcon/diff/bff951b2

Branch: refs/heads/master
Commit: bff951b2bb3850a3a3f938a4aae6deca3d4be66a
Parents: 7f795ca
Author: Suhas V <suhas.v@inmobi.com>
Authored: Thu Nov 27 15:04:22 2014 +0530
Committer: Suhas V <suhas.v@inmobi.com>
Committed: Thu Nov 27 15:04:22 2014 +0530

----------------------------------------------------------------------
 CHANGES.txt                                              |  3 +++
 .../falcon/workflow/engine/OozieWorkflowEngine.java      | 11 +++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bff951b2/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 81f6b80..79e498f 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -164,6 +164,9 @@ Release Version: 0.6-incubating
   OPTIMIZATIONS
 
   BUG FIXES
+   FALCON-917 Fix corner cases while getting job id during instance status
+   (Suhas Vasu)
+
    FALCON-829 Better error message for cluster submission failure
    (Karan Kumar via Venkatesh Seetharam)
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bff951b2/oozie/src/main/java/org/apache/falcon/workflow/engine/OozieWorkflowEngine.java
----------------------------------------------------------------------
diff --git a/oozie/src/main/java/org/apache/falcon/workflow/engine/OozieWorkflowEngine.java
b/oozie/src/main/java/org/apache/falcon/workflow/engine/OozieWorkflowEngine.java
index 41f1fe0..745aaac 100644
--- a/oozie/src/main/java/org/apache/falcon/workflow/engine/OozieWorkflowEngine.java
+++ b/oozie/src/main/java/org/apache/falcon/workflow/engine/OozieWorkflowEngine.java
@@ -109,7 +109,7 @@ public class OozieWorkflowEngine extends AbstractWorkflowEngine {
 
     private static final List<String> PARENT_WF_ACTION_NAMES = Arrays.asList(
             "pre-processing",
-            "should-record",
+            "recordsize",
             "succeeded-post-processing",
             "failed-post-processing"
     );
@@ -676,8 +676,10 @@ public class OozieWorkflowEngine extends AbstractWorkflowEngine {
         List<InstancesResult.InstanceAction> instanceActions = new ArrayList<InstancesResult.InstanceAction>();
 
         List<WorkflowAction> wfActions = wfJob.getActions();
+        // We wanna capture job urls for all user-actions & non succeeded actions of
the main workflow
         for (WorkflowAction action : wfActions) {
             if (action.getType().equalsIgnoreCase("sub-workflow") && StringUtils.isNotEmpty(action.getExternalId()))
{
+                // if the action is sub-workflow, get job urls of all actions within the
sub-workflow
                 List<WorkflowAction> subWorkFlowActions = getWorkflowInfo(cluster,
action.getExternalId()).getActions();
                 for (WorkflowAction subWfAction : subWorkFlowActions) {
                     if (!subWfAction.getType().startsWith(":")) {
@@ -688,13 +690,18 @@ public class OozieWorkflowEngine extends AbstractWorkflowEngine {
                     }
                 }
             } else if (!action.getType().startsWith(":")) {
+                // if the action is a transition node it starts with :, we don't need their
statuses
                 if (PARENT_WF_ACTION_NAMES.contains(action.getName())
                         && !Status.SUCCEEDED.toString().equals(action.getExternalStatus()))
{
+                    // falcon actions in the main workflow are defined in the list
+                    // get job urls for all non succeeded actions of the main workflow
                     InstancesResult.InstanceAction instanceAction =
                             new InstancesResult.InstanceAction(action.getName(), action.getExternalStatus(),
                                     action.getConsoleUrl());
                     instanceActions.add(instanceAction);
-                } else if (!PARENT_WF_ACTION_NAMES.contains(action.getName())) {
+                } else if (!PARENT_WF_ACTION_NAMES.contains(action.getName())
+                        && !StringUtils.equals(action.getExternalId(), "-")) {
+                    // if user-action is pig/hive there is no sub-workflow, we wanna capture
their urls as well
                     InstancesResult.InstanceAction instanceAction =
                             new InstancesResult.InstanceAction(action.getName(), action.getExternalStatus(),
                                     action.getConsoleUrl());


Mime
View raw message