diff options
author | Prashant Sharma <prashant.s@imaginea.com> | 2013-07-12 14:49:16 +0530 |
---|---|---|
committer | Prashant Sharma <prashant.s@imaginea.com> | 2013-07-12 14:49:16 +0530 |
commit | e86d5dbaad9de3c04fe080b8fb96a7ebbd20c7cd (patch) | |
tree | 2dcdbfa2daf5836357def8744447043ed2181c4e /core/src/main/scala/spark/util/AkkaUtils.scala | |
parent | 6e6d94ffdfa885432408d6996bad7df2a641748a (diff) | |
parent | bc19477efbe9ad18a27516a771dd14c497368516 (diff) | |
download | spark-e86d5dbaad9de3c04fe080b8fb96a7ebbd20c7cd.tar.gz spark-e86d5dbaad9de3c04fe080b8fb96a7ebbd20c7cd.tar.bz2 spark-e86d5dbaad9de3c04fe080b8fb96a7ebbd20c7cd.zip |
Merge branch 'master' into master-merge
Conflicts:
README.md
core/pom.xml
core/src/main/scala/spark/deploy/JsonProtocol.scala
core/src/main/scala/spark/deploy/LocalSparkCluster.scala
core/src/main/scala/spark/deploy/master/Master.scala
core/src/main/scala/spark/deploy/master/MasterWebUI.scala
core/src/main/scala/spark/deploy/worker/Worker.scala
core/src/main/scala/spark/deploy/worker/WorkerWebUI.scala
core/src/main/scala/spark/storage/BlockManagerUI.scala
core/src/main/scala/spark/util/AkkaUtils.scala
pom.xml
project/SparkBuild.scala
streaming/src/main/scala/spark/streaming/receivers/ActorReceiver.scala
Diffstat (limited to 'core/src/main/scala/spark/util/AkkaUtils.scala')
-rw-r--r-- | core/src/main/scala/spark/util/AkkaUtils.scala | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/core/src/main/scala/spark/util/AkkaUtils.scala b/core/src/main/scala/spark/util/AkkaUtils.scala index ea39888c21..c381a0510b 100644 --- a/core/src/main/scala/spark/util/AkkaUtils.scala +++ b/core/src/main/scala/spark/util/AkkaUtils.scala @@ -1,20 +1,10 @@ package spark.util -import akka.actor.{Props, ActorSystem, ExtendedActorSystem} +import akka.actor.{ActorSystem, ExtendedActorSystem} import com.typesafe.config.ConfigFactory import scala.concurrent.duration._ -import akka.pattern.ask -import akka.remote.RemoteActorRefProvider - -import spray.routing.Route -import spray.io.IOExtension -import spray.routing.HttpServiceActor -import spray.can.server.{HttpServer, ServerSettings} -import spray.io.SingletonHandler import scala.concurrent.Await -import spark.{Utils, SparkException} - -import java.util.concurrent.TimeoutException +import akka.remote.RemoteActorRefProvider /** * Various utility classes for working with Akka. @@ -65,29 +55,4 @@ private[spark] object AkkaUtils { return (actorSystem, boundPort) } - /** - * Creates a Spray HTTP server bound to a given IP and port with a given Spray Route object to - * handle requests. Returns the bound port or throws a SparkException on failure. - * TODO: Not changing ip to host here - is it required ? - */ - def startSprayServer(actorSystem: ActorSystem, ip: String, port: Int, route: Route, name: String = "HttpServer") = { - val ioWorker = IOExtension(actorSystem).ioBridge() - val httpService = actorSystem.actorOf(Props(HttpServiceActor(route))) - val server = actorSystem.actorOf( - Props(new HttpServer(ioWorker, SingletonHandler(httpService), ServerSettings())), name = name) - actorSystem.registerOnTermination { actorSystem.stop(ioWorker) } - val timeout = 3.seconds - val future = server.ask(HttpServer.Bind(ip, port))(timeout) - try { - Await.result(future, timeout) match { - case bound: HttpServer.Bound => - server - case other: Any => - throw new SparkException("Failed to bind web UI to port " + port + ": " + other) - } - } catch { - case e: TimeoutException => - throw new SparkException("Failed to bind web UI to port " + port) - } - } } |