Package org.apache.cassandra.utils
Class JVMStabilityInspector
- java.lang.Object
-
- org.apache.cassandra.utils.JVMStabilityInspector
-
public final class JVMStabilityInspector extends java.lang.Object
Responsible for deciding whether to kill the JVM if it gets in an "unstable" state (think OOM).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JVMStabilityInspector.Killer
static interface
JVMStabilityInspector.OnKillHook
This class is usually used to avoid JVM exit when running junit tests.
-
Field Summary
Fields Modifier and Type Field Description static JVMStabilityInspector.OnKillHook
killerHook
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
inspectCommitLogThrowable(java.lang.Throwable t)
static void
inspectThrowable(java.lang.Throwable t)
Certain Throwables and Exceptions represent "Die" conditions for the server.static void
inspectThrowable(java.lang.Throwable t, java.util.function.Consumer<java.lang.Throwable> fn)
static void
killCurrentJVM(java.lang.Throwable t, boolean quiet)
static JVMStabilityInspector.Killer
replaceKiller(JVMStabilityInspector.Killer newKiller)
static void
uncaughtException(java.lang.Thread thread, java.lang.Throwable t)
static void
userFunctionTimeout(java.lang.Throwable t)
-
-
-
Field Detail
-
killerHook
public static JVMStabilityInspector.OnKillHook killerHook
-
-
Method Detail
-
uncaughtException
public static void uncaughtException(java.lang.Thread thread, java.lang.Throwable t)
-
inspectThrowable
public static void inspectThrowable(java.lang.Throwable t) throws java.lang.OutOfMemoryError
Certain Throwables and Exceptions represent "Die" conditions for the server. This recursively checks the input Throwable's cause hierarchy until null.- Parameters:
t
- The Throwable to check for server-stop conditions- Throws:
java.lang.OutOfMemoryError
-
inspectCommitLogThrowable
public static void inspectCommitLogThrowable(java.lang.Throwable t)
-
inspectThrowable
public static void inspectThrowable(java.lang.Throwable t, java.util.function.Consumer<java.lang.Throwable> fn) throws java.lang.OutOfMemoryError
- Throws:
java.lang.OutOfMemoryError
-
killCurrentJVM
public static void killCurrentJVM(java.lang.Throwable t, boolean quiet)
-
userFunctionTimeout
public static void userFunctionTimeout(java.lang.Throwable t)
-
replaceKiller
public static JVMStabilityInspector.Killer replaceKiller(JVMStabilityInspector.Killer newKiller)
-
-