File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
core/src/main/scala/org/apache/spark Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1818package org .apache .spark
1919
2020import java .io .File
21- import java .net .Socket
21+ import java .net .{ InetAddress , Socket }
2222import java .util .Locale
23-
2423import scala .collection .JavaConverters ._
2524import scala .collection .concurrent
2625import scala .collection .mutable
2726import scala .util .Properties
28-
2927import com .google .common .cache .CacheBuilder
3028import org .apache .hadoop .conf .Configuration
31-
3229import org .apache .spark .annotation .DeveloperApi
3330import org .apache .spark .api .python .PythonWorkerFactory
3431import org .apache .spark .broadcast .BroadcastManager
35- import org .apache .spark .internal .{config , Logging }
32+ import org .apache .spark .internal .{Logging , config }
3633import org .apache .spark .internal .config ._
3734import org .apache .spark .memory .{MemoryManager , UnifiedMemoryManager }
3835import org .apache .spark .metrics .{MetricsSystem , MetricsSystemInstances }
@@ -204,11 +201,15 @@ object SparkEnv extends Logging {
204201 numCores : Int ,
205202 ioEncryptionKey : Option [Array [Byte ]],
206203 isLocal : Boolean ): SparkEnv = {
204+ var hostnameFinal = hostname
205+ if (conf.getBoolean(" spark.lyft.resolve" , false )) {
206+ hostnameFinal = InetAddress .getByName(hostname).getHostAddress
207+ }
207208 val env = create(
208209 conf,
209210 executorId,
210211 bindAddress,
211- hostname ,
212+ hostnameFinal ,
212213 None ,
213214 isLocal,
214215 numCores,
You can’t perform that action at this time.
0 commit comments