Skip to content
Snippets Groups Projects
Commit c1201f47 authored by Prashant Sharma's avatar Prashant Sharma
Browse files

fixed yarn build

parent 7ad6921a
No related branches found
No related tags found
No related merge requests found
...@@ -27,10 +27,8 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration ...@@ -27,10 +27,8 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration
import org.apache.hadoop.yarn.ipc.YarnRPC import org.apache.hadoop.yarn.ipc.YarnRPC
import org.apache.hadoop.yarn.util.{ConverterUtils, Records} import org.apache.hadoop.yarn.util.{ConverterUtils, Records}
import akka.actor._ import akka.actor._
import akka.remote.{RemoteClientShutdown, RemoteClientDisconnected, RemoteClientLifeCycleEvent} import akka.remote._
import akka.remote.RemoteClientShutdown
import akka.actor.Terminated import akka.actor.Terminated
import akka.remote.RemoteClientDisconnected
import org.apache.spark.{SparkContext, Logging} import org.apache.spark.{SparkContext, Logging}
import org.apache.spark.util.{Utils, AkkaUtils} import org.apache.spark.util.{Utils, AkkaUtils}
import org.apache.spark.scheduler.cluster.CoarseGrainedSchedulerBackend import org.apache.spark.scheduler.cluster.CoarseGrainedSchedulerBackend
...@@ -55,19 +53,18 @@ class WorkerLauncher(args: ApplicationMasterArguments, conf: Configuration) exte ...@@ -55,19 +53,18 @@ class WorkerLauncher(args: ApplicationMasterArguments, conf: Configuration) exte
// This actor just working as a monitor to watch on Driver Actor. // This actor just working as a monitor to watch on Driver Actor.
class MonitorActor(driverUrl: String) extends Actor { class MonitorActor(driverUrl: String) extends Actor {
var driver: ActorRef = null var driver: ActorSelection = null
override def preStart() { override def preStart() {
logInfo("Listen to driver: " + driverUrl) logInfo("Listen to driver: " + driverUrl)
driver = context.actorFor(driverUrl) driver = context.actorSelection(driverUrl)
driver ! "hello" driver ! "hello"
context.system.eventStream.subscribe(self, classOf[RemoteClientLifeCycleEvent]) context.system.eventStream.subscribe(self, classOf[RemotingLifecycleEvent])
context.watch(driver) // Doesn't work with remote actors, but useful for testing
} }
override def receive = { override def receive = {
case Terminated(_) | RemoteClientDisconnected(_, _) | RemoteClientShutdown(_, _) => case x: DisassociatedEvent =>
logInfo("Driver terminated or disconnected! Shutting down.") logInfo(s"Driver terminated or disconnected! Shutting down. $x")
driverClosed = true driverClosed = true
} }
} }
......
...@@ -34,7 +34,7 @@ import org.apache.hadoop.conf.Configuration ...@@ -34,7 +34,7 @@ import org.apache.hadoop.conf.Configuration
import java.util.{Collections, Set => JSet} import java.util.{Collections, Set => JSet}
import java.lang.{Boolean => JBoolean} import java.lang.{Boolean => JBoolean}
object AllocationType extends Enumeration ("HOST", "RACK", "ANY") { object AllocationType extends Enumeration {
type AllocationType = Value type AllocationType = Value
val HOST, RACK, ANY = Value val HOST, RACK, ANY = Value
} }
...@@ -370,7 +370,7 @@ private[yarn] class YarnAllocationHandler(val conf: Configuration, val resourceM ...@@ -370,7 +370,7 @@ private[yarn] class YarnAllocationHandler(val conf: Configuration, val resourceM
createResourceRequest(AllocationType.ANY, null, numWorkers, YarnAllocationHandler.PRIORITY) createResourceRequest(AllocationType.ANY, null, numWorkers, YarnAllocationHandler.PRIORITY)
val containerRequests: ArrayBuffer[ResourceRequest] = val containerRequests: ArrayBuffer[ResourceRequest] =
new ArrayBuffer[ResourceRequest](hostContainerRequests.size() + rackContainerRequests.size() + 1) new ArrayBuffer[ResourceRequest](hostContainerRequests.size + rackContainerRequests.size + 1)
containerRequests ++= hostContainerRequests containerRequests ++= hostContainerRequests
containerRequests ++= rackContainerRequests containerRequests ++= rackContainerRequests
......
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