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

    https://github.com/apache/spark/pull/5964#discussion_r30862115
  
    --- Diff: 
core/src/main/scala/org/apache/spark/shuffle/IndexShuffleBlockResolver.scala ---
    @@ -74,12 +74,16 @@ private[spark] class IndexShuffleBlockResolver(conf: 
SparkConf) extends ShuffleB
        * end of the output file. This will be used by getBlockLocation to 
figure out where each block
        * begins and ends.
        * */
    -  def writeIndexFile(shuffleId: Int, mapId: Int, lengths: Array[Long]): 
Unit = {
    +  def writeIndexFile(
    +      shuffleId: Int,
    +      mapId: Int,
    +      lengths: Array[Long],
    +      initialFileLength: Long): Unit = {
         val indexFile = getIndexFile(shuffleId, mapId)
         val out = new DataOutputStream(new BufferedOutputStream(new 
FileOutputStream(indexFile)))
         Utils.tryWithSafeFinally {
           // We take in lengths of each block, need to convert it to offsets.
    -      var offset = 0L
    +      var offset = initialFileLength
    --- End diff --
    
    to fix issue (2) -- data files are appended, but before this, index files 
always pointed to the beginning of the data file.


---
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