Skip to content

Commit 304cb0b

Browse files
committed
History Server: updated order for multiple attempts(reverted HistoryPage)
1 parent 85024e8 commit 304cb0b

File tree

1 file changed

+69
-69
lines changed

1 file changed

+69
-69
lines changed

core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -64,61 +64,61 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("")
6464
{providerConfig.map { case (k, v) => <li><strong>{k}:</strong> {v}</li> }}
6565
</ul>
6666
{
67-
// This displays the indices of pages that are within `plusOrMinus` pages of
68-
// the current page. Regardless of where the current page is, this also links
69-
// to the first and last page. If the current page +/- `plusOrMinus` is greater
70-
// than the 2nd page from the first page or less than the 2nd page from the last
71-
// page, `...` will be displayed.
72-
if (allAppsSize > 0) {
73-
val leftSideIndices =
74-
rangeIndices(actualPage - plusOrMinus until actualPage, 1 < _, requestedIncomplete)
75-
val rightSideIndices =
76-
rangeIndices(actualPage + 1 to actualPage + plusOrMinus, _ < pageCount,
77-
requestedIncomplete)
78-
79-
<h4>
80-
Showing {actualFirst + 1}-{last + 1} of {allAppsSize}
81-
{if (requestedIncomplete) "(Incomplete applications)"}
82-
<span style="float: right">
83-
{
84-
if (actualPage > 1) {
85-
<a href={makePageLink(actualPage - 1, requestedIncomplete)}>&lt; </a>
86-
<a href={makePageLink(1, requestedIncomplete)}>1</a>
87-
}
88-
}
89-
{if (actualPage - plusOrMinus > secondPageFromLeft) " ... "}
90-
{leftSideIndices}
91-
{actualPage}
92-
{rightSideIndices}
93-
{if (actualPage + plusOrMinus < secondPageFromRight) " ... "}
94-
{
95-
if (actualPage < pageCount) {
96-
<a href={makePageLink(pageCount, requestedIncomplete)}>{pageCount}</a>
97-
<a href={makePageLink(actualPage + 1, requestedIncomplete)}> &gt;</a>
98-
}
99-
}
100-
</span>
101-
</h4> ++
67+
// This displays the indices of pages that are within `plusOrMinus` pages of
68+
// the current page. Regardless of where the current page is, this also links
69+
// to the first and last page. If the current page +/- `plusOrMinus` is greater
70+
// than the 2nd page from the first page or less than the 2nd page from the last
71+
// page, `...` will be displayed.
72+
if (allAppsSize > 0) {
73+
val leftSideIndices =
74+
rangeIndices(actualPage - plusOrMinus until actualPage, 1 < _, requestedIncomplete)
75+
val rightSideIndices =
76+
rangeIndices(actualPage + 1 to actualPage + plusOrMinus, _ < pageCount,
77+
requestedIncomplete)
78+
79+
<h4>
80+
Showing {actualFirst + 1}-{last + 1} of {allAppsSize}
81+
{if (requestedIncomplete) "(Incomplete applications)"}
82+
<span style="float: right">
83+
{
84+
if (actualPage > 1) {
85+
<a href={makePageLink(actualPage - 1, requestedIncomplete)}>&lt; </a>
86+
<a href={makePageLink(1, requestedIncomplete)}>1</a>
87+
}
88+
}
89+
{if (actualPage - plusOrMinus > secondPageFromLeft) " ... "}
90+
{leftSideIndices}
91+
{actualPage}
92+
{rightSideIndices}
93+
{if (actualPage + plusOrMinus < secondPageFromRight) " ... "}
94+
{
95+
if (actualPage < pageCount) {
96+
<a href={makePageLink(pageCount, requestedIncomplete)}>{pageCount}</a>
97+
<a href={makePageLink(actualPage + 1, requestedIncomplete)}> &gt;</a>
98+
}
99+
}
100+
</span>
101+
</h4> ++
102102
appTable
103-
} else if (requestedIncomplete) {
104-
<h4>No incomplete applications found!</h4>
105-
} else {
106-
<h4>No completed applications found!</h4> ++
103+
} else if (requestedIncomplete) {
104+
<h4>No incomplete applications found!</h4>
105+
} else {
106+
<h4>No completed applications found!</h4> ++
107107
<p>Did you specify the correct logging directory?
108108
Please verify your setting of <span style="font-style:italic">
109109
spark.history.fs.logDirectory</span> and whether you have the permissions to
110110
access it.<br /> It is also possible that your application did not run to
111111
completion or did not stop the SparkContext.
112112
</p>
113-
}
113+
}
114114
}
115115
<a href={makePageLink(actualPage, !requestedIncomplete)}>
116116
{
117-
if (requestedIncomplete) {
118-
"Back to completed applications"
119-
} else {
120-
"Show incomplete applications"
121-
}
117+
if (requestedIncomplete) {
118+
"Back to completed applications"
119+
} else {
120+
"Show incomplete applications"
121+
}
122122
}
123123
</a>
124124
</div>
@@ -146,18 +146,18 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("")
146146
"Last Updated")
147147

148148
private def rangeIndices(
149-
range: Seq[Int],
150-
condition: Int => Boolean,
151-
showIncomplete: Boolean): Seq[Node] = {
149+
range: Seq[Int],
150+
condition: Int => Boolean,
151+
showIncomplete: Boolean): Seq[Node] = {
152152
range.filter(condition).map(nextPage =>
153153
<a href={makePageLink(nextPage, showIncomplete)}> {nextPage} </a>)
154154
}
155155

156156
private def attemptRow(
157-
renderAttemptIdColumn: Boolean,
158-
info: ApplicationHistoryInfo,
159-
attempt: ApplicationAttemptInfo,
160-
isFirst: Boolean): Seq[Node] = {
157+
renderAttemptIdColumn: Boolean,
158+
info: ApplicationHistoryInfo,
159+
attempt: ApplicationAttemptInfo,
160+
isFirst: Boolean): Seq[Node] = {
161161
val uiAddress = HistoryServer.getAttemptURI(info.id, attempt.attemptId)
162162
val startTime = UIUtils.formatDate(attempt.startTime)
163163
val endTime = if (attempt.endTime > 0) UIUtils.formatDate(attempt.endTime) else "-"
@@ -170,31 +170,31 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("")
170170
val lastUpdated = UIUtils.formatDate(attempt.lastUpdated)
171171
<tr>
172172
{
173-
if (isFirst) {
174-
if (info.attempts.size > 1 || renderAttemptIdColumn) {
175-
<td rowspan={info.attempts.size.toString} style="background-color: #ffffff">
176-
<a href={uiAddress}>{info.id}</a></td>
173+
if (isFirst) {
174+
if (info.attempts.size > 1 || renderAttemptIdColumn) {
175+
<td rowspan={info.attempts.size.toString} style="background-color: #ffffff">
176+
<a href={uiAddress}>{info.id}</a></td>
177177
<td rowspan={info.attempts.size.toString} style="background-color: #ffffff">
178178
{info.name}</td>
179-
} else {
180-
<td><a href={uiAddress}>{info.id}</a></td>
179+
} else {
180+
<td><a href={uiAddress}>{info.id}</a></td>
181181
<td>{info.name}</td>
182+
}
183+
} else {
184+
Nil
182185
}
183-
} else {
184-
Nil
185-
}
186186
}
187187
{
188-
if (renderAttemptIdColumn) {
189-
if (info.attempts.size > 1 && attempt.attemptId.isDefined) {
190-
<td><a href={HistoryServer.getAttemptURI(info.id, attempt.attemptId)}>
191-
{attempt.attemptId.get}</a></td>
188+
if (renderAttemptIdColumn) {
189+
if (info.attempts.size > 1 && attempt.attemptId.isDefined) {
190+
<td><a href={HistoryServer.getAttemptURI(info.id, attempt.attemptId)}>
191+
{attempt.attemptId.get}</a></td>
192+
} else {
193+
<td>&nbsp;</td>
194+
}
192195
} else {
193-
<td>&nbsp;</td>
196+
Nil
194197
}
195-
} else {
196-
Nil
197-
}
198198
}
199199
<td sorttable_customkey={attempt.startTime.toString}>{startTime}</td>
200200
<td sorttable_customkey={attempt.endTime.toString}>{endTime}</td>

0 commit comments

Comments
 (0)