Skip to content

Commit

Permalink
executor plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
squito committed Jun 26, 2018
1 parent 5264164 commit 0ca9482
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/main/scala/org/apache/spark/executor/Executor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ private[spark] class Executor(
private val urlClassLoader = createClassLoader()
private val replClassLoader = addReplClassLoaderIfNeeded(urlClassLoader)

Thread.currentThread().setContextClassLoader(replClassLoader)
conf.get(EXECUTOR_PLUGINS).foreach { classes =>
Utils.loadExtensions(classOf[Object], classes, conf)
}


// Set the classloader for serializer
env.serializer.setDefaultClassLoader(replClassLoader)
// SPARK-21928. SerializerManager's internal instance of Kryo might get used in netty threads
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,4 +559,13 @@ package object config {
.intConf
.checkValue(v => v > 0, "The value should be a positive integer.")
.createWithDefault(2000)

private[spark] val EXECUTOR_PLUGINS =
ConfigBuilder("spark.executor.plugins")
.internal()
.doc("Comma-separated list of class names for \"plugins\" to run on executor startup. Each" +
" should have a no-arg apply() static method")
.stringConf
.toSequence
.createOptional
}

0 comments on commit 0ca9482

Please sign in to comment.