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

    https://github.com/apache/spark/pull/9000#discussion_r41561465
  
    --- Diff: 
core/src/main/scala/org/apache/spark/shuffle/ShuffleMemoryManager.scala ---
    @@ -138,30 +150,27 @@ class ShuffleMemoryManager protected (
     
     private[spark] object ShuffleMemoryManager {
     
    -  def create(conf: SparkConf, numCores: Int): ShuffleMemoryManager = {
    -    val maxMemory = ShuffleMemoryManager.getMaxMemory(conf)
    +  def create(
    +      conf: SparkConf,
    +      memoryManager: MemoryManager,
    +      numCores: Int): ShuffleMemoryManager = {
    +    val maxMemory = memoryManager.maxExecutionMemory
         val pageSize = ShuffleMemoryManager.getPageSize(conf, maxMemory, 
numCores)
    -    new ShuffleMemoryManager(maxMemory, pageSize)
    +    new ShuffleMemoryManager(memoryManager, pageSize)
       }
     
    +  /**
    +   * Create a dummy [[ShuffleMemoryManager]] with the specified capacity 
and page size.
    +   */
       def create(maxMemory: Long, pageSizeBytes: Long): ShuffleMemoryManager = 
{
    -    new ShuffleMemoryManager(maxMemory, pageSizeBytes)
    +    val conf = new SparkConf
    +    val memoryManager = new StaticMemoryManager(conf, maxMemory, 
Long.MaxValue)
    --- End diff --
    
    This is a totally minor nit to be picking, but do you mind explicitly 
naming these parameters at their call sites?  e.g.
    
    ```
    new StaticMemoryManager(conf, maxExecutionMemory = maxMemory, 
maxStorageMemory = Long.MaxValue)
    ```
    
    I think this makes the code slightly easier to read.


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