Brushing the code up slightly

This commit is contained in:
Ali Ghodsi 2013-09-02 19:04:08 -07:00
parent cf7b115496
commit e452bd6d77
2 changed files with 4 additions and 4 deletions

View file

@ -129,6 +129,6 @@ private[deploy] object DeployMessages {
case object RequestWebUIPort
case class WebUIPortResponse(boundedPort: Int) {}
case class WebUIPortResponse(webUIBoundPort: Int) {}
}

View file

@ -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)
}
}