Skip to content

Commit 9868358

Browse files
committed
Add a few miscellaneous ports
1 parent 6016e77 commit 9868358

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

core/src/main/scala/org/apache/spark/deploy/Client.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ object Client {
146146
}
147147

148148
val conf = new SparkConf()
149+
val port = conf.getInt("spark.standalone.client.port", 0) // TODO: document this
149150
val driverArgs = new ClientArguments(args)
150151

151152
if (!driverArgs.logLevel.isGreaterOrEqual(Level.WARN)) {
@@ -158,7 +159,7 @@ object Client {
158159
// TODO: See if we can initialize akka so return messages are sent back using the same TCP
159160
// flow. Else, this (sadly) requires the DriverClient be routable from the Master.
160161
val (actorSystem, _) = AkkaUtils.createActorSystem(
161-
"driverClient", Utils.localHostName(), 0, conf, new SecurityManager(conf))
162+
"driverClient", Utils.localHostName(), port, conf, new SecurityManager(conf))
162163

163164
actorSystem.actorOf(Props(classOf[ClientActor], driverArgs, conf))
164165

core/src/main/scala/org/apache/spark/deploy/worker/DriverWrapper.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ object DriverWrapper {
3030
args.toList match {
3131
case workerUrl :: mainClass :: extraArgs =>
3232
val conf = new SparkConf()
33+
val watcherPort = conf.getInt("spark.worker.watcher.port", 0) // TODO: document this
3334
val (actorSystem, _) = AkkaUtils.createActorSystem("Driver",
34-
Utils.localHostName(), 0, conf, new SecurityManager(conf))
35+
Utils.localHostName(), watcherPort, conf, new SecurityManager(conf))
3536
actorSystem.actorOf(Props(classOf[WorkerWatcher], workerUrl), name = "workerWatcher")
3637

3738
// Delegate to supplied main class

core/src/main/scala/org/apache/spark/executor/Executor.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ private[spark] class Executor(
8484
// Initialize Spark environment (using system properties read above)
8585
private val env = {
8686
if (!isLocal) {
87-
val _env = SparkEnv.create(conf, executorId, slaveHostname, 0,
87+
val port = conf.getInt("spark.executor.env.port", 0) // TODO: document this
88+
val _env = SparkEnv.create(conf, executorId, slaveHostname, port,
8889
isDriver = false, isLocal = false)
8990
SparkEnv.set(_env)
9091
_env.metricsSystem.registerSource(executorSource)

0 commit comments

Comments
 (0)