Package org.apache.spark.util
Class ShutdownHookManager
Object
org.apache.spark.util.ShutdownHookManager
Various utility methods used by Spark.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic ObjectaddShutdownHook(int priority, scala.Function0<scala.runtime.BoxedUnit> hook) Adds a shutdown hook with the given priority.static ObjectaddShutdownHook(scala.Function0<scala.runtime.BoxedUnit> hook) Adds a shutdown hook with default priority.static intstatic booleanstatic booleanhasShutdownDeleteDir(File file) static booleanDetect whether this thread might be executing a shutdown hook.static org.apache.spark.internal.Logging.LogStringContextLogStringContext(scala.StringContext sc) static org.slf4j.Loggerstatic voidorg$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1) static voidstatic voidremoveShutdownDeleteDir(File file) static booleanremoveShutdownHook(Object ref) Remove a previously installed shutdown hook.static intThe shutdown priority of the SparkContext instance.static intThe shutdown priority of temp directory must be lower than the SparkContext shutdown priority.
- 
Constructor Details- 
ShutdownHookManagerpublic ShutdownHookManager()
 
- 
- 
Method Details- 
DEFAULT_SHUTDOWN_PRIORITYpublic static int DEFAULT_SHUTDOWN_PRIORITY()
- 
SPARK_CONTEXT_SHUTDOWN_PRIORITYpublic static int SPARK_CONTEXT_SHUTDOWN_PRIORITY()The shutdown priority of the SparkContext instance. This is lower than the default priority, so that by default hooks are run before the context is shut down.- Returns:
- (undocumented)
 
- 
TEMP_DIR_SHUTDOWN_PRIORITYpublic static int TEMP_DIR_SHUTDOWN_PRIORITY()The shutdown priority of temp directory must be lower than the SparkContext shutdown priority. Otherwise cleaning the temp directories while Spark jobs are running can throw undesirable errors at the time of shutdown.- Returns:
- (undocumented)
 
- 
registerShutdownDeleteDir
- 
removeShutdownDeleteDir
- 
hasShutdownDeleteDir
- 
hasRootAsShutdownDeleteDir
- 
inShutdownpublic static boolean inShutdown()Detect whether this thread might be executing a shutdown hook. Will always return true if the current thread is a running a shutdown hook but may spuriously return true otherwise (e.g. if System.exit was just called by a concurrent thread).Currently, this detects whether the JVM is shutting down by Runtime#addShutdownHook throwing an IllegalStateException. - Returns:
- (undocumented)
 
- 
addShutdownHookAdds a shutdown hook with default priority.- Parameters:
- hook- The code to run during shutdown.
- Returns:
- A handle that can be used to unregister the shutdown hook.
 
- 
addShutdownHookAdds a shutdown hook with the given priority. Hooks with higher priority values run first.- Parameters:
- hook- The code to run during shutdown.
- priority- (undocumented)
- Returns:
- A handle that can be used to unregister the shutdown hook.
 
- 
removeShutdownHookRemove a previously installed shutdown hook.- Parameters:
- ref- A handle returned by- addShutdownHook.
- Returns:
- Whether the hook was removed.
 
- 
org$apache$spark$internal$Logging$$log_public static org.slf4j.Logger org$apache$spark$internal$Logging$$log_()
- 
org$apache$spark$internal$Logging$$log__$eqpublic static void org$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1) 
- 
LogStringContextpublic static org.apache.spark.internal.Logging.LogStringContext LogStringContext(scala.StringContext sc) 
 
-