Author: mona
Date: Fri Dec 28 18:59:18 2012
New Revision: 1426607

URL: http://svn.apache.org/viewvc?rev=1426607&view=rev
Log:
OOZIE-1135 Display missing partition dependencies via job -info command on CLI 
(mona)

Modified:
    
oozie/branches/hcat-intre/client/src/main/java/org/apache/oozie/cli/OozieCLI.java
    
oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/CoordinatorActionBean.java
    
oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionGetForInfoJPAExecutor.java
    
oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobGetActionsSubsetJPAExecutor.java
    oozie/branches/hcat-intre/release-log.txt

Modified: 
oozie/branches/hcat-intre/client/src/main/java/org/apache/oozie/cli/OozieCLI.java
URL: 
http://svn.apache.org/viewvc/oozie/branches/hcat-intre/client/src/main/java/org/apache/oozie/cli/OozieCLI.java?rev=1426607&r1=1426606&r2=1426607&view=diff
==============================================================================
--- 
oozie/branches/hcat-intre/client/src/main/java/org/apache/oozie/cli/OozieCLI.java
 (original)
+++ 
oozie/branches/hcat-intre/client/src/main/java/org/apache/oozie/cli/OozieCLI.java
 Fri Dec 28 18:59:18 2012
@@ -978,10 +978,6 @@ public class OozieCLI {
             System.out.println(RULER);
 
             for (CoordinatorAction action : actions) {
-                String missingDep = action.getMissingDependencies();
-                if(missingDep != null && !missingDep.isEmpty()) {
-                    missingDep = missingDep.split(INSTANCE_SEPARATOR)[0];
-                }
                 System.out.println(maskIfNull(action.getId()) + 
VERBOSE_DELIMITER + action.getActionNumber()
                         + VERBOSE_DELIMITER + 
maskIfNull(action.getConsoleUrl()) + VERBOSE_DELIMITER
                         + maskIfNull(action.getErrorCode()) + 
VERBOSE_DELIMITER + maskIfNull(action.getErrorMessage())
@@ -991,7 +987,7 @@ public class OozieCLI {
                         + maskDate(action.getCreatedTime(), timeZoneId, 
verbose) + VERBOSE_DELIMITER
                         + maskDate(action.getNominalTime(), timeZoneId, 
verbose) + action.getStatus() + VERBOSE_DELIMITER
                         + maskDate(action.getLastModifiedTime(), timeZoneId, 
verbose) + VERBOSE_DELIMITER
-                        + maskIfNull(missingDep));
+                        + maskIfNull(getAllMissingDependencies(action)));
 
                 System.out.println(RULER);
             }
@@ -1053,11 +1049,7 @@ public class OozieCLI {
         System.out.println("Nominal Time         : " + 
maskDate(coordAction.getNominalTime(), timeZoneId, false));
         System.out.println("Status               : " + 
coordAction.getStatus());
         System.out.println("Last Modified        : " + 
maskDate(coordAction.getLastModifiedTime(), timeZoneId, false));
-        String missingDep = coordAction.getMissingDependencies();
-        if(missingDep != null && !missingDep.isEmpty()) {
-            missingDep = missingDep.split(INSTANCE_SEPARATOR)[0];
-        }
-        System.out.println("First Missing Dependency : " + 
maskIfNull(missingDep));
+        System.out.println("Missing Dependencies : " + 
maskIfNull(getAllMissingDependencies(coordAction)));
 
         System.out.println(RULER);
     }
@@ -1527,7 +1519,7 @@ public class OozieCLI {
                 Schema schema = factory.newSchema(sources.toArray(new 
StreamSource[sources.size()]));
                 Validator validator = schema.newValidator();
                 validator.validate(new StreamSource(new FileReader(file)));
-                System.out.println("Valid worflow-app");
+                System.out.println("Valid workflow-app");
             }
             catch (Exception ex) {
                 throw new OozieCLIException("Invalid workflow-app, " + 
ex.toString(), ex);
@@ -1627,4 +1619,23 @@ public class OozieCLI {
             throw new OozieCLIException(ex.toString(), ex);
         }
     }
+
+    private String getAllMissingDependencies(CoordinatorAction action) {
+        StringBuilder allDeps = new StringBuilder();
+        String missingDep = action.getMissingDependencies();
+        boolean depExists = false;
+        if (missingDep != null && !missingDep.isEmpty()) {
+            allDeps.append(missingDep.split(INSTANCE_SEPARATOR)[0]);
+            depExists = true;
+        }
+        String pushDeps = action.getPushMissingDependencies();
+        if (pushDeps != null && !pushDeps.isEmpty()) {
+            if(depExists) {
+                allDeps.append(INSTANCE_SEPARATOR);
+            }
+            allDeps.append(pushDeps);
+        }
+        return allDeps.toString();
+    }
+
 }

Modified: 
oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/CoordinatorActionBean.java
URL: 
http://svn.apache.org/viewvc/oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/CoordinatorActionBean.java?rev=1426607&r1=1426606&r2=1426607&view=diff
==============================================================================
--- 
oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/CoordinatorActionBean.java
 (original)
+++ 
oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/CoordinatorActionBean.java
 Fri Dec 28 18:59:18 2012
@@ -71,7 +71,7 @@ import org.apache.openjpa.persistence.jd
         @NamedQuery(name = "GET_COORD_ACTION", query = "select OBJECT(a) from 
CoordinatorActionBean a where a.id = :id"),
 
         // Select query used by ActionInfo command
-        @NamedQuery(name = "GET_COORD_ACTION_FOR_INFO", query = "select a.id, 
a.jobId, a.actionNumber, a.consoleUrl, a.errorCode, a.errorMessage, 
a.externalId, a.externalStatus, a.trackerUri, a.createdTimestamp, 
a.nominalTimestamp, a.status, a.lastModifiedTimestamp, a.missingDependencies 
from CoordinatorActionBean a where a.id = :id"),
+        @NamedQuery(name = "GET_COORD_ACTION_FOR_INFO", query = "select a.id, 
a.jobId, a.actionNumber, a.consoleUrl, a.errorCode, a.errorMessage, 
a.externalId, a.externalStatus, a.trackerUri, a.createdTimestamp, 
a.nominalTimestamp, a.status, a.lastModifiedTimestamp, a.missingDependencies, 
a.pushMissingDependencies from CoordinatorActionBean a where a.id = :id"),
         // Select Query used by Timeout command
         @NamedQuery(name = "GET_COORD_ACTION_FOR_TIMEOUT", query = "select 
a.id, a.jobId, a.status, a.runConf, a.pending from CoordinatorActionBean a 
where a.id = :id"),
         // Select query used by InputCheck command
@@ -99,7 +99,7 @@ import org.apache.openjpa.persistence.jd
 
         @NamedQuery(name = "GET_ACTIONS_FOR_COORD_JOB", query = "select 
count(a) from CoordinatorActionBean a where a.jobId = :jobId"),
         // Query to retrieve Coordinator actions sorted by nominal time
-        @NamedQuery(name = "GET_ACTIONS_FOR_COORD_JOB_ORDER_BY_NOMINAL_TIME", 
query = "select a.id, a.actionNumber, a.consoleUrl, a.errorCode, 
a.errorMessage, a.externalId, a.externalStatus, a.jobId, a.trackerUri, 
a.createdTimestamp, a.nominalTimestamp, a.status, a.lastModifiedTimestamp, 
a.missingDependencies, a.timeOut from CoordinatorActionBean a where a.jobId = 
:jobId order by a.nominalTimestamp"),
+        @NamedQuery(name = "GET_ACTIONS_FOR_COORD_JOB_ORDER_BY_NOMINAL_TIME", 
query = "select a.id, a.actionNumber, a.consoleUrl, a.errorCode, 
a.errorMessage, a.externalId, a.externalStatus, a.jobId, a.trackerUri, 
a.createdTimestamp, a.nominalTimestamp, a.status, a.lastModifiedTimestamp, 
a.missingDependencies, a.pushMissingDependencies, a.timeOut from 
CoordinatorActionBean a where a.jobId = :jobId order by a.nominalTimestamp"),
         // Query to maintain backward compatibility for coord job info command
         @NamedQuery(name = 
"GET_ALL_COLS_FOR_ACTIONS_FOR_COORD_JOB_ORDER_BY_NOMINAL_TIME", query = "select 
OBJECT(a) from CoordinatorActionBean a where a.jobId = :jobId order by 
a.nominalTimestamp"),
         // Query to retrieve action id, action status, pending status and 
external Id of not completed Coordinator actions

Modified: 
oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionGetForInfoJPAExecutor.java
URL: 
http://svn.apache.org/viewvc/oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionGetForInfoJPAExecutor.java?rev=1426607&r1=1426606&r2=1426607&view=diff
==============================================================================
--- 
oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionGetForInfoJPAExecutor.java
 (original)
+++ 
oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionGetForInfoJPAExecutor.java
 Fri Dec 28 18:59:18 2012
@@ -109,6 +109,7 @@ public class CoordActionGetForInfoJPAExe
             action.setCreatedConf(a.getCreatedConf());
             action.setExternalStatus(a.getExternalStatus());
             action.setMissingDependencies(a.getMissingDependencies());
+            action.setPushMissingDependencies(a.getPushMissingDependencies());
             action.setRunConf(a.getRunConf());
             action.setTimeOut(a.getTimeOut());
             action.setTrackerUri(a.getTrackerUri());
@@ -171,6 +172,9 @@ public class CoordActionGetForInfoJPAExe
         if (arr[13] != null) {
             bean.setMissingDependencies((String) arr[13]);
         }
+        if (arr[14] != null) {
+            bean.setPushMissingDependencies((String) arr[14]);
+        }
         return bean;
     }
 }

Modified: 
oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobGetActionsSubsetJPAExecutor.java
URL: 
http://svn.apache.org/viewvc/oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobGetActionsSubsetJPAExecutor.java?rev=1426607&r1=1426606&r2=1426607&view=diff
==============================================================================
--- 
oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobGetActionsSubsetJPAExecutor.java
 (original)
+++ 
oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobGetActionsSubsetJPAExecutor.java
 Fri Dec 28 18:59:18 2012
@@ -17,7 +17,6 @@
  */
 package org.apache.oozie.executor.jpa;
 
-import java.sql.Date;
 import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.List;
@@ -137,6 +136,7 @@ public class CoordJobGetActionsSubsetJPA
             action.setCreatedConf(a.getCreatedConf());
             action.setExternalStatus(a.getExternalStatus());
             action.setMissingDependencies(a.getMissingDependencies());
+            action.setPushMissingDependencies(a.getPushMissingDependencies());
             action.setRunConf(a.getRunConf());
             action.setTimeOut(a.getTimeOut());
             action.setTrackerUri(a.getTrackerUri());
@@ -198,7 +198,10 @@ public class CoordJobGetActionsSubsetJPA
             bean.setMissingDependencies((String) arr[13]);
         }
         if (arr[14] != null) {
-            bean.setTimeOut((Integer) arr[14]);
+            bean.setPushMissingDependencies((String) arr[14]);
+        }
+        if (arr[15] != null) {
+            bean.setTimeOut((Integer) arr[15]);
         }
         return bean;
 

Modified: oozie/branches/hcat-intre/release-log.txt
URL: 
http://svn.apache.org/viewvc/oozie/branches/hcat-intre/release-log.txt?rev=1426607&r1=1426606&r2=1426607&view=diff
==============================================================================
--- oozie/branches/hcat-intre/release-log.txt (original)
+++ oozie/branches/hcat-intre/release-log.txt Fri Dec 28 18:59:18 2012
@@ -1,5 +1,6 @@
 -- Oozie 3.4.0 release (trunk - unreleased)
 
+OOZIE-1135 Display missing partition dependencies via job -info command on CLI 
(mona)
 OOZIE-1125 Prepare actions for hcat (rohini via virag)
 OOZIE-1123 EL Functions for hcatalog (mona)
 OOZIE-1138 Provide rule based mechanism to allow multiple hcatalog servers to 
connect to JMS server (virag)


Reply via email to