public class ShutdownHookManager
extends java.lang.Object
Constructor and Description |
---|
ShutdownHookManager() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
addShutdownHook(scala.Function0<scala.runtime.BoxedUnit> hook)
Adds a shutdown hook with default priority.
|
static java.lang.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) |
protected static void |
initializeLogIfNecessary(boolean isInterpreter) |
static boolean |
inShutdown()
Detect whether this thread might be executing a shutdown hook.
|
protected static boolean |
isTraceEnabled() |
protected static org.slf4j.Logger |
log() |
protected static void |
logDebug(scala.Function0<java.lang.String> msg) |
protected static void |
logDebug(scala.Function0<java.lang.String> msg,
java.lang.Throwable throwable) |
protected static void |
logError(scala.Function0<java.lang.String> msg) |
protected static void |
logError(scala.Function0<java.lang.String> msg,
java.lang.Throwable throwable) |
protected static void |
logInfo(scala.Function0<java.lang.String> msg) |
protected static void |
logInfo(scala.Function0<java.lang.String> msg,
java.lang.Throwable throwable) |
protected static java.lang.String |
logName() |
protected static void |
logTrace(scala.Function0<java.lang.String> msg) |
protected static void |
logTrace(scala.Function0<java.lang.String> msg,
java.lang.Throwable throwable) |
protected static void |
logWarning(scala.Function0<java.lang.String> msg) |
protected static void |
logWarning(scala.Function0<java.lang.String> msg,
java.lang.Throwable throwable) |
static void |
registerShutdownDeleteDir(java.io.File file) |
static void |
removeShutdownDeleteDir(java.io.File file) |
static boolean |
removeShutdownHook(java.lang.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 java.lang.Object addShutdownHook(scala.Function0<scala.runtime.BoxedUnit> hook)
hook
- The code to run during shutdown.public static java.lang.Object addShutdownHook(int priority, scala.Function0<scala.runtime.BoxedUnit> hook)
hook
- The code to run during shutdown.priority
- (undocumented)public static boolean removeShutdownHook(java.lang.Object ref)
ref
- A handle returned by addShutdownHook
.protected static java.lang.String logName()
protected static org.slf4j.Logger log()
protected static void logInfo(scala.Function0<java.lang.String> msg)
protected static void logDebug(scala.Function0<java.lang.String> msg)
protected static void logTrace(scala.Function0<java.lang.String> msg)
protected static void logWarning(scala.Function0<java.lang.String> msg)
protected static void logError(scala.Function0<java.lang.String> msg)
protected static void logInfo(scala.Function0<java.lang.String> msg, java.lang.Throwable throwable)
protected static void logDebug(scala.Function0<java.lang.String> msg, java.lang.Throwable throwable)
protected static void logTrace(scala.Function0<java.lang.String> msg, java.lang.Throwable throwable)
protected static void logWarning(scala.Function0<java.lang.String> msg, java.lang.Throwable throwable)
protected static void logError(scala.Function0<java.lang.String> msg, java.lang.Throwable throwable)
protected static boolean isTraceEnabled()
protected static void initializeLogIfNecessary(boolean isInterpreter)