Permalink
Browse files

Incorporated review feedback

  • Loading branch information...
1 parent a51ceff commit 65c2c74003a84690af7f7c7d4d1cfd24f57384fe Chao Wang committed Aug 6, 2011
View
4 client/src/main/java/org/apache/oozie/cli/OozieCLI.java
@@ -781,9 +781,7 @@ private void printJob(WorkflowJob job, boolean localtime, boolean verbose) throw
System.out.println("Started : " + maskDate(job.getStartTime(), localtime));
System.out.println("Last Modified : " + maskDate(job.getLastModifiedTime(), localtime));
System.out.println("Ended : " + maskDate(job.getEndTime(), localtime));
- if (job.getProgress() >= 0) { // -1.0f means no progress is available, therefore do not display.
- System.out.printf("%% Complete : %.2f%%\n", job.getProgress() * 100f);
- }
+ System.out.printf("%% Complete : %.2f%%\n", job.getProgress() * 100f);
List<WorkflowAction> actions = job.getActions();
View
5 client/src/main/java/org/apache/oozie/client/rest/JsonToBean.java
@@ -194,9 +194,8 @@ else if (type == Integer.TYPE) {
else if (type == Long.TYPE) {
return (obj != null) ? obj : new Long(0);
}
- else if (type == Float.TYPE) { // This is used for getting job's progress value;
- // get the float progress value, or -1.0 if not defined (progress info not available).
- return (obj != null) ? new Float(((Double) obj).floatValue()) : new Float(-1);
+ else if (type == Float.TYPE) {
+ return new Float(((Double) obj).floatValue());
}
else if (type == Date.class) {
return JsonUtils.parseDateRfc822((String) obj);
View
6 client/src/main/java/org/apache/oozie/client/rest/JsonUtils.java
@@ -16,16 +16,10 @@
import java.text.ParseException;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
import java.util.Date;
-import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-
-
/**
* Json utils methods.
*/
View
7 core/src/main/java/org/apache/oozie/command/wf/JobCommand.java
@@ -100,7 +100,12 @@ static float getJobProgress(WorkflowJobBean wf) {
if (action.getType().equals(DecisionActionExecutor.ACTION_TYPE)) {
continue;
}
- if (action.getStatus() == WorkflowAction.Status.OK || action.getStatus() == WorkflowAction.Status.DONE) {
+ // Make progress if an action is in terminal state
+ if (action.getStatus() == WorkflowAction.Status.OK
+ || action.getStatus() == WorkflowAction.Status.DONE
+ || action.getStatus() == WorkflowAction.Status.ERROR
+ || action.getStatus() == WorkflowAction.Status.FAILED
+ || action.getStatus() == WorkflowAction.Status.KILLED) {
doneActions++;
}
}

0 comments on commit 65c2c74

Please sign in to comment.