Skip to content
Snippets Groups Projects
Commit 85024acd authored by jerryshao's avatar jerryshao
Browse files

Remove infix style and others

parent 5850f599
No related branches found
No related tags found
No related merge requests found
......@@ -17,14 +17,12 @@
package org.apache.spark.scheduler.cluster
import java.io.{File, FileInputStream, FileOutputStream, FileNotFoundException, InputStream}
import java.io.{FileInputStream, InputStream}
import java.util.Properties
import scala.xml.XML
import org.apache.spark.Logging
import org.apache.spark.scheduler.cluster.SchedulingMode.SchedulingMode
import scala.xml.XML
/**
* An interface to build Schedulable tree
......@@ -67,17 +65,17 @@ private[spark] class FairSchedulableBuilder(val rootPool: Pool)
override def buildPools() {
var is: Option[InputStream] = None
try {
is = Option {
schedulerAllocFile map { f =>
is = Option{
schedulerAllocFile.map{ f =>
new FileInputStream(f)
} getOrElse {
}.getOrElse{
getClass.getClassLoader.getResourceAsStream(DEFAULT_SCHEDULER_FILE)
}
}
is foreach { i => buildFairSchedulerPool(i) }
is.foreach{ i => buildFairSchedulerPool(i) }
} finally {
is.foreach(_.close)
is.foreach(_.close())
}
// finally create "default" pool
......@@ -108,7 +106,7 @@ private[spark] class FairSchedulableBuilder(val rootPool: Pool)
try {
schedulingMode = SchedulingMode.withName(xmlSchedulingMode)
} catch {
case e: Exception => logInfo("Error xml schedulingMode, using default schedulingMode")
case e: Exception => logWarning("Error xml schedulingMode, using default schedulingMode")
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment