spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JoshRosen <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-10708] Consolidate sort shuffle impleme...
Date Tue, 20 Oct 2015 22:01:45 GMT
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8829#discussion_r42560830
  
    --- Diff: core/src/main/java/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriter.java
---
    @@ -124,13 +153,19 @@ public void insertAll(Iterator<Product2<K, V>> records)
throws IOException {
         for (DiskBlockObjectWriter writer : partitionWriters) {
           writer.commitAndClose();
         }
    +
    +    partitionLengths =
    +      writePartitionedFile(shuffleBlockResolver.getDataFile(shuffleId, mapId));
    +    shuffleBlockResolver.writeIndexFile(shuffleId, mapId, partitionLengths);
    +    mapStatus = MapStatus$.MODULE$.apply(blockManager.shuffleServerId(), partitionLengths);
       }
     
    -  @Override
    -  public long[] writePartitionedFile(
    -      BlockId blockId,
    -      TaskContext context,
    -      File outputFile) throws IOException {
    +  // Exposed for testing
    +  long[] getPartitionLengths() {
    +    return partitionLengths;
    +  }
    +
    +  private long[] writePartitionedFile(File outputFile) throws IOException {
    --- End diff --
    
    Copied and adapted the comment from the regular SortShuffleWriter:
    
    ```scala
      /**
       * Concatenate all of the per-partition files into a single combined file.
       *
       * @return array of lengths, in bytes, of each partition of the file (used by map output
tracker)
       */
    ```


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