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

    https://github.com/apache/spark/pull/17329#discussion_r108032378
  
    --- Diff: 
common/network-common/src/main/java/org/apache/spark/network/buffer/FileSegmentManagedBuffer.java
 ---
    @@ -37,13 +37,24 @@
      * A {@link ManagedBuffer} backed by a segment in a file.
      */
     public final class FileSegmentManagedBuffer extends ManagedBuffer {
    -  private final TransportConf conf;
    +  private final boolean lazyFileDescriptor;
    +  private final int memoryMapBytes;
       private final File file;
       private final long offset;
       private final long length;
     
       public FileSegmentManagedBuffer(TransportConf conf, File file, long 
offset, long length) {
    -    this.conf = conf;
    +    this(conf.lazyFileDescriptor(), conf.memoryMapBytes(), file, offset, 
length);
    +  }
    +
    +  public FileSegmentManagedBuffer(
    --- End diff --
    
    Suppose there are E Executor in the cluster, a shuffle process has M Map 
task, R reduce task, in the master branch will be created:
    
    1. Up to M * R FileSegmentManagedBuffer instances
    2. Up to 2 * M * R NoSuchElementException instances
    
    in this PR will be created:
    
    1. Up to M * R FileSegmentManagedBuffer instances
    2. Up to 2 * NoSuchElementException instances (ExternalShuffleBlockResolver 
and IndexShuffleBlockResolver are created once executor starts and They call 
the new constructor to create a FileSegmentManagedBuffer instance)


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