ZEPPELIN-528 Add 'progress' to paragraph information when running

* It would be hard to trap RUNNING state, so I can't add UT
This commit is contained in:
Jungtaek Lim 2015-12-22 14:34:58 +09:00
parent 16e921b6ad
commit 2597ebfcdc
2 changed files with 6 additions and 3 deletions

View file

@ -58,15 +58,15 @@ public abstract class Job {
FINISHED,
ERROR,
ABORT;
boolean isReady() {
public boolean isReady() {
return this == READY;
}
boolean isRunning() {
public boolean isRunning() {
return this == RUNNING;
}
boolean isPending() {
public boolean isPending() {
return this == PENDING;
}
}

View file

@ -303,6 +303,9 @@ public class Note implements Serializable, JobListener {
info.put("status", p.getStatus().toString());
info.put("started", p.getDateStarted().toString());
info.put("finished", p.getDateFinished().toString());
if (p.getStatus().isRunning()) {
info.put("progress", String.valueOf(p.progress()));
}
paragraphsInfo.add(info);
}
}