|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.regionserver.ShutdownHook
@InterfaceAudience.Private public class ShutdownHook
Manage regionserver shutdown hooks.
install(Configuration, FileSystem, Stoppable, Thread)| Field Summary | |
|---|---|
static String |
FS_SHUTDOWN_HOOK_WAIT
Key for a long configuration on how much time to wait on the fs shutdown hook. |
static String |
RUN_SHUTDOWN_HOOK
Key for boolean configuration whose default is true. |
| Constructor Summary | |
|---|---|
ShutdownHook()
|
|
| Method Summary | |
|---|---|
static void |
install(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
Stoppable stop,
Thread threadToJoin)
Install a shutdown hook that calls stop on the passed Stoppable and then thread joins against the passed threadToJoin. |
static void |
main(String[] args)
Main to test basic functionality. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String RUN_SHUTDOWN_HOOK
public static final String FS_SHUTDOWN_HOOK_WAIT
| Constructor Detail |
|---|
public ShutdownHook()
| Method Detail |
|---|
public static void install(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
Stoppable stop,
Thread threadToJoin)
threadToJoin.
When this thread completes, it then runs the hdfs thread (This install
removes the hdfs shutdown hook keeping a handle on it to run it after
threadToJoin has stopped).
To suppress all shutdown hook handling -- both the running of the
regionserver hook and of the hdfs hook code -- set
RUN_SHUTDOWN_HOOK in Configuration to
false.
This configuration value is checked when the hook code runs.
conf - fs - Instance of Filesystem used by the RegionServerstop - Installed shutdown hook will call stop against this passed
Stoppable instance.threadToJoin - After calling stop on stop will then
join this thread.
public static void main(String[] args)
throws IOException
args -
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||