Skip to content
Snippets Groups Projects
Commit 9831bc1a authored by Matei Zaharia's avatar Matei Zaharia
Browse files

Merge pull request #539 from cgrothaus/fix-webui-workdirpath

Bugfix: WorkerWebUI must respect workDirPath from Worker
parents 3cc8ab6e 445f387e
No related branches found
No related tags found
No related merge requests found
......@@ -81,7 +81,7 @@ private[spark] class Worker(
}
def startWebUi() {
val webUi = new WorkerWebUI(context.system, self)
val webUi = new WorkerWebUI(context.system, self, workDir)
try {
AkkaUtils.startSprayServer(context.system, "0.0.0.0", webUiPort, webUi.handler)
} catch {
......
......@@ -12,12 +12,13 @@ import cc.spray.typeconversion.SprayJsonSupport._
import spark.deploy.{WorkerState, RequestWorkerState}
import spark.deploy.JsonProtocol._
import java.io.File
/**
* Web UI server for the standalone worker.
*/
private[spark]
class WorkerWebUI(val actorSystem: ActorSystem, worker: ActorRef) extends Directives {
class WorkerWebUI(val actorSystem: ActorSystem, worker: ActorRef, workDir: File) extends Directives {
val RESOURCE_DIR = "spark/deploy/worker/webui"
val STATIC_RESOURCE_DIR = "spark/deploy/static"
......@@ -43,7 +44,7 @@ class WorkerWebUI(val actorSystem: ActorSystem, worker: ActorRef) extends Direct
path("log") {
parameters("appId", "executorId", "logType") { (appId, executorId, logType) =>
respondWithMediaType(cc.spray.http.MediaTypes.`text/plain`) {
getFromFileName("work/" + appId + "/" + executorId + "/" + logType)
getFromFileName(workDir.getPath() + "/" + appId + "/" + executorId + "/" + logType)
}
}
} ~
......
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