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

    https://github.com/apache/spark/pull/3172#discussion_r20056709
  
    --- Diff: 
network/common/src/main/java/org/apache/spark/network/buffer/FileSegmentManagedBuffer.java
 ---
    @@ -31,27 +31,27 @@
     
     import org.apache.spark.network.util.JavaUtils;
     import org.apache.spark.network.util.LimitedInputStream;
    +import org.apache.spark.network.util.SystemPropertyConfigProvider;
    +import org.apache.spark.network.util.TransportConf;
     
     /**
      * A {@link ManagedBuffer} backed by a segment in a file.
      */
     public final class FileSegmentManagedBuffer extends ManagedBuffer {
    -
    -  /**
    -   * Memory mapping is expensive and can destabilize the JVM (SPARK-1145, 
SPARK-3889).
    -   * Avoid unless there's a good reason not to.
    -   */
    -  // TODO: Make this configurable
    -  private static final long MIN_MEMORY_MAP_BYTES = 2 * 1024 * 1024;
    -
       private final File file;
       private final long offset;
       private final long length;
    +  private final TransportConf conf;
     
    -  public FileSegmentManagedBuffer(File file, long offset, long length) {
    +  public FileSegmentManagedBuffer(File file, long offset, long length, 
TransportConf conf) {
         this.file = file;
         this.offset = offset;
         this.length = length;
    +    this.conf = conf;
    +  }
    +
    +  public FileSegmentManagedBuffer(File file, long offset, long length) {
    --- End diff --
    
    Please add a comment that the other constructor is preferred (this creates 
an extra object, for instance, and gets configuration from a random place).


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