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

    https://github.com/apache/spark/pull/16813#discussion_r99717324
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/SchedulableBuilder.scala ---
    @@ -69,19 +72,29 @@ private[spark] class FairSchedulableBuilder(val 
rootPool: Pool, conf: SparkConf)
       val DEFAULT_WEIGHT = 1
     
       override def buildPools() {
    -    var is: Option[InputStream] = None
    +    var fileData: Option[FileData] = None
         try {
    -      is = Option {
    -        schedulerAllocFile.map { f =>
    -          new FileInputStream(f)
    -        }.getOrElse {
    -          
Utils.getSparkClassLoader.getResourceAsStream(DEFAULT_SCHEDULER_FILE)
    +      fileData = schedulerAllocFile.map { f =>
    +        Some(FileData(new FileInputStream(f), f))
    +      }.getOrElse {
    +        val is = 
Utils.getSparkClassLoader.getResourceAsStream(DEFAULT_SCHEDULER_FILE)
    +        if(is != null) Some(FileData(is, DEFAULT_SCHEDULER_FILE))
    +        else {
    +          logWarning(s"No Fair Scheduler file found.")
    +          None
             }
           }
     
    -      is.foreach { i => buildFairSchedulerPool(i) }
    +      fileData.foreach { data =>
    +        logInfo(s"Fair Scheduler file: ${data.fileName} is found 
successfully and will be parsed.")
    --- End diff --
    
    nit: I find this a little confusing in the case where the default filename 
was used -- since the user didn't actually specify that file.  Can you log 
separately in the two cases?   So to use Mark's suggested message, s"Creating 
Fair Scheduler pools from ${data.fileName}" in the first case, and in the 
second case, s"Creating Fair Scheduler pools from default file 
($DEFAULT_SCHEDULER_FILE). That way you can also keep the old code 
organization, which was a bit clearer.


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