Github user CodingCat commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8533#discussion_r38915025
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskLocation.scala 
---
    @@ -35,16 +37,26 @@ case class ExecutorCacheTaskLocation(override val host: 
String, executorId: Stri
     
     /**
      * A location on a host.
    + * The host names will be resolved to IP address in case 
SPARK_LOCAL_HOSTNAME is unset
      */
     private [spark] case class HostTaskLocation(override val host: String) 
extends TaskLocation {
    -  override def toString: String = host
    +  override def toString: String = if ( sys.env.get("SPARK_LOCAL_HOSTNAME") 
== None ) {
    +    InetAddress.getByName(host).getHostAddress
    +  } else {
    +    host
    +  }
     }
     
     /**
      * A location on a host that is cached by HDFS.
    + * The host names will be resolved to IP address in case 
SPARK_LOCAL_HOSTNAME is unset
      */
     private [spark] case class HDFSCacheTaskLocation(override val host: 
String) extends TaskLocation {
    -  override def toString: String = TaskLocation.inMemoryLocationTag + host
    +  override def toString: String = if ( sys.env.get("SPARK_LOCAL_HOSTNAME") 
== None ) {
    --- End diff --
    
    would you like to move 'sys.env.get("SPARK_LOCAL_HOSTNAME")' to `object 
TaskLocation`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to