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

    https://github.com/apache/spark/pull/5645#discussion_r29372590
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/rdd/WriteAheadLogBackedBlockRDD.scala
 ---
    @@ -111,14 +140,20 @@ class WriteAheadLogBackedBlockRDD[T: ClassTag](
     
       /**
        * Get the preferred location of the partition. This returns the 
locations of the block
    -   * if it is present in the block manager, else it returns the location 
of the
    -   * corresponding segment in HDFS.
    +   * if it is present in the block manager, else if 
FileBasedWriteAheadLogSegment is used,
    +   * it returns the location of the corresponding file segment in HDFS .
        */
       override def getPreferredLocations(split: Partition): Seq[String] = {
         val partition = 
split.asInstanceOf[WriteAheadLogBackedBlockRDDPartition]
         val blockLocations = getBlockIdLocations().get(partition.blockId)
    -    blockLocations.getOrElse(
    -      HdfsUtils.getFileSegmentLocations(
    -        partition.segment.path, partition.segment.offset, 
partition.segment.length, hadoopConfig))
    +    blockLocations.getOrElse {
    --- End diff --
    
    It might make sense to add location info to the WALRecordHandle interface 
itself. This way, systems that are not HDFS, but still benefit from preferred 
locations can use it.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to