public class ShutdownHookManager
extends Object
Constructor and Description |
---|
ShutdownHookManager() |
Modifier and Type | Method and Description |
---|---|
static Object |
addShutdownHook(scala.Function0<scala.runtime.BoxedUnit> hook)
Adds a shutdown hook with default priority.
|
static Object |
addShutdownHook(int priority,
scala.Function0<scala.runtime.BoxedUnit> hook)
Adds a shutdown hook with the given priority.
|
static int |
DEFAULT_SHUTDOWN_PRIORITY() |
static boolean |
hasRootAsShutdownDeleteDir(java.io.File file) |
static boolean |
hasShutdownDeleteDir(java.io.File file) |
static boolean |
inShutdown()
Detect whether this thread might be executing a shutdown hook.
|
static void |
registerShutdownDeleteDir(java.io.File file) |
static void |
removeShutdownDeleteDir(java.io.File file) |
static boolean |
removeShutdownHook(Object ref)
Remove a previously installed shutdown hook.
|
static int |
SPARK_CONTEXT_SHUTDOWN_PRIORITY()
The shutdown priority of the SparkContext instance.
|
static int |
TEMP_DIR_SHUTDOWN_PRIORITY()
The shutdown priority of temp directory must be lower than the SparkContext shutdown
priority.
|
public static int DEFAULT_SHUTDOWN_PRIORITY()
public static int SPARK_CONTEXT_SHUTDOWN_PRIORITY()
public static int TEMP_DIR_SHUTDOWN_PRIORITY()
public static void registerShutdownDeleteDir(java.io.File file)
public static void removeShutdownDeleteDir(java.io.File file)
public static boolean hasShutdownDeleteDir(java.io.File file)
public static boolean hasRootAsShutdownDeleteDir(java.io.File file)
public static boolean inShutdown()
Currently, this detects whether the JVM is shutting down by Runtime#addShutdownHook throwing an IllegalStateException.
public static Object addShutdownHook(scala.Function0<scala.runtime.BoxedUnit> hook)
hook
- The code to run during shutdown.public static Object addShutdownHook(int priority, scala.Function0<scala.runtime.BoxedUnit> hook)
hook
- The code to run during shutdown.priority
- (undocumented)public static boolean removeShutdownHook(Object ref)
ref
- A handle returned by addShutdownHook
.