Class InterruptEscalator
java.lang.Object
org.apache.hadoop.service.launcher.InterruptEscalator
- All Implemented Interfaces:
IrqHandler.Interrupted
Handles interrupts by shutting down a service, escalating if the service
does not shut down in time, or when other interrupts are received.
- The service is given a time in milliseconds to stop: if it exceeds this it the process exits anyway.
- the exit operation used is
ServiceLauncher.exit(int, String)with the exit codeLauncherExitCodes.EXIT_INTERRUPTED - If a second shutdown signal is received during the shutdown
process,
ExitUtil.halt(int)is invoked. This handles the problem of blocking shutdown hooks.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classForced shutdown runnable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinterrupted(IrqHandler.InterruptData interruptData) Handle an interrupt.booleanFlag set if forced shut down timed out.booleanFlag set if a signal has been received.Look up the handler for a signal.voidRegister an interrupt handler.toString()
-
Constructor Details
-
InterruptEscalator
-
-
Method Details
-
toString
-
interrupted
Description copied from interface:IrqHandler.InterruptedHandle an interrupt.- Specified by:
interruptedin interfaceIrqHandler.Interrupted- Parameters:
interruptData- data
-
register
Register an interrupt handler.- Parameters:
signalName- signal name- Throws:
IllegalArgumentException- if the registration failed
-
lookup
Look up the handler for a signal.- Parameters:
signalName- signal name- Returns:
- a handler if found
-
isForcedShutdownTimedOut
public boolean isForcedShutdownTimedOut()Flag set if forced shut down timed out.- Returns:
- true if a shutdown was attempted and it timed out
-
isSignalAlreadyReceived
public boolean isSignalAlreadyReceived()Flag set if a signal has been received.- Returns:
- true if there has been one interrupt already.
-