MAPREDUCE-6816. Progress bars in Web UI always at 100%. Contributed by Shen Yinjie.

This commit is contained in:
Akira Ajisaka 2016-12-07 06:41:08 +09:00
parent 6b4a9970f1
commit da4ecc9f82
3 changed files with 4 additions and 4 deletions

View File

@ -125,7 +125,7 @@ public class TaskPage extends AppView {
for (TaskAttempt attempt : getTaskAttempts()) { for (TaskAttempt attempt : getTaskAttempts()) {
TaskAttemptInfo ta = new TaskAttemptInfo(attempt, true); TaskAttemptInfo ta = new TaskAttemptInfo(attempt, true);
String progress = StringUtils.formatPercent(ta.getProgress() / 100, 2); String progress = StringUtils.format("%.2f", ta.getProgress());
String nodeHttpAddr = ta.getNode(); String nodeHttpAddr = ta.getNode();
String diag = ta.getNote() == null ? "" : ta.getNote(); String diag = ta.getNote() == null ? "" : ta.getNote();

View File

@ -94,7 +94,7 @@ public class TasksBlock extends HtmlBlock {
TaskInfo info = new TaskInfo(task); TaskInfo info = new TaskInfo(task);
String tid = info.getId(); String tid = info.getId();
String pct = StringUtils.formatPercent(info.getProgress() / 100, 2); String pct = StringUtils.format("%.2f", info.getProgress());
tasksTableData.append("[\"<a href='").append(url("task", tid)) tasksTableData.append("[\"<a href='").append(url("task", tid))
.append("'>").append(tid).append("</a>\",\"") .append("'>").append(tid).append("</a>\",\"")
//Progress bar //Progress bar

View File

@ -104,12 +104,12 @@ public class JobInfo {
this.mapsCompleted = job.getCompletedMaps(); this.mapsCompleted = job.getCompletedMaps();
this.mapProgress = report.getMapProgress() * 100; this.mapProgress = report.getMapProgress() * 100;
this.mapProgressPercent = this.mapProgressPercent =
StringUtils.formatPercent(report.getMapProgress(), 2); StringUtils.format("%.2f", getMapProgress());
this.reducesTotal = job.getTotalReduces(); this.reducesTotal = job.getTotalReduces();
this.reducesCompleted = job.getCompletedReduces(); this.reducesCompleted = job.getCompletedReduces();
this.reduceProgress = report.getReduceProgress() * 100; this.reduceProgress = report.getReduceProgress() * 100;
this.reduceProgressPercent = this.reduceProgressPercent =
StringUtils.formatPercent(report.getReduceProgress(), 2); StringUtils.format("%.2f", getReduceProgress());
this.acls = new ArrayList<ConfEntryInfo>(); this.acls = new ArrayList<ConfEntryInfo>();
if (hasAccess) { if (hasAccess) {