Modifier and Type | Field and Description |
---|---|
static Set<CommonUtils.ProcessType> |
COLLECT_ON_EXIT |
static java.time.format.DateTimeFormatter |
DATETIME_FORMAT |
static boolean |
sInfoDumpOnExitCheck |
Modifier and Type | Method and Description |
---|---|
static void |
dumpInformationOnExit()
Outputs process critical information like metrics and jstack before it exits.
|
static List<Future<Void>> |
dumpInformationOnFailover(ExecutorService es)
Outputs process critical information like metrics and jstack before the primary master
fails over to standby.
|
static void |
fatalError(org.slf4j.Logger logger,
String format,
Object... args)
Logs a fatal error and then exits the system.
|
static void |
fatalError(org.slf4j.Logger logger,
Throwable t,
String format,
Object... args)
Logs a fatal error and then exits the system.
|
static void |
run(Process process)
Runs the given
Process . |
static void |
stopProcessOnShutdown(Process process)
Adds a shutdown hook that will be invoked when a signal is sent to this process.
|
public static final Set<CommonUtils.ProcessType> COLLECT_ON_EXIT
public static volatile boolean sInfoDumpOnExitCheck
public static final java.time.format.DateTimeFormatter DATETIME_FORMAT
public static void run(Process process)
Process
. This method should only be called from main()
methods.process
- the Process
to runpublic static void fatalError(org.slf4j.Logger logger, String format, Object... args)
logger
- the logger to log toformat
- the error message format stringargs
- args for the format stringpublic static void fatalError(org.slf4j.Logger logger, Throwable t, String format, Object... args)
logger
- the logger to log tot
- the throwable causing the fatal errorformat
- the error message format stringargs
- args for the format stringpublic static void stopProcessOnShutdown(Process process)
Process.stop()
method to cleanly release the resources and exit.process
- the data structure representing the process to terminatepublic static void dumpInformationOnExit()
public static List<Future<Void>> dumpInformationOnFailover(ExecutorService es)
es
- the thread pool to submit tasks toCopyright © 2023. All Rights Reserved.