Skip to content

Commit 4024b61

Browse files
harishreedharanjeanlyn
authored andcommitted
[HOTFIX] History Server API docs error fix.
Minor error in the monitoring docs. Also made indentation changes in `ApiRootResource` Author: Hari Shreedharan <[email protected]> Closes apache#6628 from harishreedharan/eventlog-formatting and squashes the following commits: a12553d [Hari Shreedharan] Javadoc updates. ca399b6 [Hari Shreedharan] [HOTFIX] History Server API docs error fix.
1 parent 8b4636c commit 4024b61

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

core/src/main/scala/org/apache/spark/status/api/v1/ApiRootResource.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,14 @@ private[v1] class ApiRootResource extends UIRootFromServletContext {
167167

168168
@Path("applications/{appId}/logs")
169169
def getEventLogs(
170-
@PathParam("appId") appId: String): EventLogDownloadResource = {
170+
@PathParam("appId") appId: String): EventLogDownloadResource = {
171171
new EventLogDownloadResource(uiRoot, appId, None)
172172
}
173173

174174
@Path("applications/{appId}/{attemptId}/logs")
175175
def getEventLogs(
176-
@PathParam("appId") appId: String,
177-
@PathParam("attemptId") attemptId: String): EventLogDownloadResource = {
176+
@PathParam("appId") appId: String,
177+
@PathParam("attemptId") attemptId: String): EventLogDownloadResource = {
178178
new EventLogDownloadResource(uiRoot, appId, Some(attemptId))
179179
}
180180
}
@@ -206,6 +206,10 @@ private[spark] trait UIRoot {
206206
def getSparkUI(appKey: String): Option[SparkUI]
207207
def getApplicationInfoList: Iterator[ApplicationInfo]
208208

209+
/**
210+
* Write the event logs for the given app to the [[ZipOutputStream]] instance. If attemptId is
211+
* [[None]], event logs for all attempts of this application will be written out.
212+
*/
209213
def writeEventLogs(appId: String, attemptId: Option[String], zipStream: ZipOutputStream): Unit = {
210214
Response.serverError()
211215
.entity("Event logs are only available through the history server.")

core/src/main/scala/org/apache/spark/status/api/v1/EventLogDownloadResource.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private[v1] class EventLogDownloadResource(
4444
}
4545

4646
val stream = new StreamingOutput {
47-
override def write(output: OutputStream) = {
47+
override def write(output: OutputStream): Unit = {
4848
val zipStream = new ZipOutputStream(output)
4949
try {
5050
uIRoot.writeEventLogs(appId, attemptId, zipStream)

docs/monitoring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ for a running application, at `http://localhost:4040/api/v1`.
233233
<td>Download the event logs for all attempts of the given application as a zip file</td>
234234
</tr>
235235
<tr>
236-
<td><code>/applications/[app-id]/[attempt-id/logs</code></td>
236+
<td><code>/applications/[app-id]/[attempt-id]/logs</code></td>
237237
<td>Download the event logs for the specified attempt of the given application as a zip file</td>
238238
</tr>
239239
</table>

0 commit comments

Comments
 (0)