Skip to content
Snippets Groups Projects
Commit 73dfd42f authored by Patrick Wendell's avatar Patrick Wendell
Browse files

Merge pull request #437 from mridulm/master

Minor api usability changes

- Expose checkpoint directory - since it is autogenerated now
- null check for jars
- Expose SparkHadoopUtil : so that configuration creation is abstracted even from user code to avoid duplication of functionality already in spark.
parents 4c16f79c b690e11d
No related branches found
No related tags found
No related merge requests found
......@@ -956,6 +956,8 @@ class SparkContext(
}
}
def getCheckpointDir = checkpointDir
/** Default level of parallelism to use when not given by user (e.g. parallelize and makeRDD). */
def defaultParallelism: Int = taskScheduler.defaultParallelism
......@@ -1125,7 +1127,7 @@ object SparkContext {
if (sparkHome != null) {
res.setSparkHome(sparkHome)
}
if (!jars.isEmpty) {
if (jars != null && !jars.isEmpty) {
res.setJars(jars)
}
res.setExecutorEnv(environment.toSeq)
......
......@@ -513,6 +513,8 @@ class JavaSparkContext(val sc: SparkContext) extends JavaSparkContextVarargsWork
sc.setCheckpointDir(dir)
}
def getCheckpointDir = JavaUtils.optionToOptional(sc.getCheckpointDir)
protected def checkpointFile[T](path: String): JavaRDD[T] = {
implicit val cm: ClassTag[T] =
implicitly[ClassTag[AnyRef]].asInstanceOf[ClassTag[T]]
......
......@@ -28,7 +28,6 @@ import org.apache.spark.{SparkContext, SparkException}
/**
* Contains util methods to interact with Hadoop from Spark.
*/
private[spark]
class SparkHadoopUtil {
val conf = newConfiguration()
UserGroupInformation.setConfiguration(conf)
......
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