Skip to content

Commit

Permalink
Better scaladoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Vanzin committed Apr 20, 2015
1 parent fcaeedd commit edfafb1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2138,6 +2138,9 @@ private[spark] object Utils extends Logging {

/**
* Adds a shutdown hook with default priority.
*
* @param hook The code to run during shutdown.
* @return A handle that can be used to unregister the shutdown hook.
*/
def addShutdownHook(hook: () => Unit): AnyRef = {
addShutdownHook(DEFAULT_SHUTDOWN_PRIORITY, hook)
Expand All @@ -2146,13 +2149,19 @@ private[spark] object Utils extends Logging {
/**
* Adds a shutdown hook with the given priority. Hooks with lower priority values run
* first.
*
* @param hook The code to run during shutdown.
* @return A handle that can be used to unregister the shutdown hook.
*/
def addShutdownHook(priority: Int, hook: () => Unit): AnyRef = {
shutdownHooks.add(priority, hook)
}

/**
* Remove a previously installed shutdown hook.
*
* @param ref A handle returned by `addShutdownHook`.
* @return Whether the hook was removed.
*/
def removeShutdownHook(ref: AnyRef): Boolean = {
shutdownHooks.remove(ref)
Expand Down

0 comments on commit edfafb1

Please sign in to comment.