spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pwendell <...@git.apache.org>
Subject [GitHub] spark pull request: SPARK-1767: Prefer HDFS-cached replicas when s...
Date Tue, 16 Sep 2014 16:30:03 GMT
Github user pwendell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1486#discussion_r17612851
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskLocation.scala ---
    @@ -23,12 +23,35 @@ package org.apache.spark.scheduler
      * of preference will be executors on the same host if this is not possible.
      */
     private[spark]
    -class TaskLocation private (val host: String, val executorId: Option[String]) extends
Serializable {
    -  override def toString: String = "TaskLocation(" + host + ", " + executorId + ")"
    +sealed abstract class TaskLocation(val host: String) {
    +}
    +
    +private [spark] case class ExecutorCacheTaskLocation(override val host: String,
    +    val executorId: String) extends TaskLocation(host) {
    +}
    +
    +private [spark] case class HDFSCachedTaskLocation(override val host: String)
    +    extends TaskLocation(host) {
    +  override def toString = TaskLocation.in_memory_location_tag + host
    +}
    +
    +private [spark] case class HostTaskLocation(override val host: String) extends TaskLocation(host)
{
    +  override def toString = host
     }
     
     private[spark] object TaskLocation {
    -  def apply(host: String, executorId: String) = new TaskLocation(host, Some(executorId))
    +  // We identify hosts on which the block is cached with this prefix.  Because this prefix
contains
    +  // underscores, which are not legal characters in hostnames, there should be no potential
for
    +  // confusion.  See  RFC 952 and RFC 1123 for information about the format of hostnames.
    +  val in_memory_location_tag = "_M_"
    --- End diff --
    
    Could you make this lower case to match other cases where we do this? e.g. `hdfs_cache_`



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message