Skip to content
Snippets Groups Projects
Commit e452bd6d authored by Ali Ghodsi's avatar Ali Ghodsi
Browse files

Brushing the code up slightly

parent cf7b1154
No related branches found
No related tags found
No related merge requests found
......@@ -129,6 +129,6 @@ private[deploy] object DeployMessages {
case object RequestWebUIPort
case class WebUIPortResponse(boundedPort: Int) {}
case class WebUIPortResponse(webUIBoundPort: Int) {}
}
......@@ -389,9 +389,9 @@ private[spark] object Master {
def startSystemAndActor(host: String, port: Int, webUiPort: Int): (ActorSystem, Int, Int) = {
val (actorSystem, boundPort) = AkkaUtils.createActorSystem(systemName, host, port)
val actor = actorSystem.actorOf(Props(new Master(host, boundPort, webUiPort)), name = actorName)
implicit val timeout = Timeout(1 seconds)
val respFuture = actor ? RequestWebUIPort
implicit val timeout = Timeout(5 seconds)
val respFuture = actor ? RequestWebUIPort // ask pattern
val resp = Await.result(respFuture, timeout.duration).asInstanceOf[WebUIPortResponse]
(actorSystem, boundPort, resp.boundedPort)
(actorSystem, boundPort, resp.webUIBoundPort)
}
}
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