Skip to content
Snippets Groups Projects
Commit 566cb594 authored by Hari Shreedharan's avatar Hari Shreedharan Committed by Andrew Or
Browse files

[HOTFIX] History Server API docs error fix.

Minor error in the monitoring docs. Also made indentation changes in `ApiRootResource`

Author: Hari Shreedharan <hshreedharan@apache.org>

Closes #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.
parent bfbdab12
No related branches found
No related tags found
No related merge requests found
......@@ -167,14 +167,14 @@ private[v1] class ApiRootResource extends UIRootFromServletContext {
@Path("applications/{appId}/logs")
def getEventLogs(
@PathParam("appId") appId: String): EventLogDownloadResource = {
@PathParam("appId") appId: String): EventLogDownloadResource = {
new EventLogDownloadResource(uiRoot, appId, None)
}
@Path("applications/{appId}/{attemptId}/logs")
def getEventLogs(
@PathParam("appId") appId: String,
@PathParam("attemptId") attemptId: String): EventLogDownloadResource = {
@PathParam("appId") appId: String,
@PathParam("attemptId") attemptId: String): EventLogDownloadResource = {
new EventLogDownloadResource(uiRoot, appId, Some(attemptId))
}
}
......@@ -206,6 +206,10 @@ private[spark] trait UIRoot {
def getSparkUI(appKey: String): Option[SparkUI]
def getApplicationInfoList: Iterator[ApplicationInfo]
/**
* Write the event logs for the given app to the [[ZipOutputStream]] instance. If attemptId is
* [[None]], event logs for all attempts of this application will be written out.
*/
def writeEventLogs(appId: String, attemptId: Option[String], zipStream: ZipOutputStream): Unit = {
Response.serverError()
.entity("Event logs are only available through the history server.")
......
......@@ -44,7 +44,7 @@ private[v1] class EventLogDownloadResource(
}
val stream = new StreamingOutput {
override def write(output: OutputStream) = {
override def write(output: OutputStream): Unit = {
val zipStream = new ZipOutputStream(output)
try {
uIRoot.writeEventLogs(appId, attemptId, zipStream)
......
......@@ -233,7 +233,7 @@ for a running application, at `http://localhost:4040/api/v1`.
<td>Download the event logs for all attempts of the given application as a zip file</td>
</tr>
<tr>
<td><code>/applications/[app-id]/[attempt-id/logs</code></td>
<td><code>/applications/[app-id]/[attempt-id]/logs</code></td>
<td>Download the event logs for the specified attempt of the given application as a zip file</td>
</tr>
</table>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment