Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Incorporated review feedback
  • Loading branch information
Chao Wang committed Aug 6, 2011
1 parent a51ceff commit 65c2c74
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
4 changes: 1 addition & 3 deletions client/src/main/java/org/apache/oozie/cli/OozieCLI.java
Expand Up @@ -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();

Expand Down
Expand Up @@ -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);
Expand Down
Expand Up @@ -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.
*/
Expand Down
Expand Up @@ -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++;
}
}
Expand Down

0 comments on commit 65c2c74

Please sign in to comment.