Package com.illumon.iris.db.tables.utils
Class SystemicObjectTracker
java.lang.Object
com.illumon.iris.db.tables.utils.SystemicObjectTracker
public class SystemicObjectTracker extends Object
If enabled, marks objects as systemically important.
When enabled, only errors from systemically important objects are reported to the controller to terminate the query.
-
Constructor Summary
Constructors Constructor Description SystemicObjectTracker()
-
Method Summary
Modifier and Type Method Description static <T> T
executeSystemically(boolean systemicThread, Supplier<T> supplier)
Execute the supplier with the thread's systemic importance set to the value of systemicThread.static boolean
isSystemic(SystemicObject o)
Determine if an object is systemic.static boolean
isSystemicObjectMarkingEnabled()
static boolean
isSystemicThread()
static void
markThreadSystemic()
Marks the current thread as systemically important, this is a permanent change.
-
Constructor Details
-
SystemicObjectTracker
public SystemicObjectTracker()
-
-
Method Details
-
isSystemicObjectMarkingEnabled
public static boolean isSystemicObjectMarkingEnabled()- Returns:
- true if systemic object marking is enabled, false otherwise.
-
isSystemicThread
public static boolean isSystemicThread()- Returns:
- true if the current thread is creating systemic objects, false otherwise
-
markThreadSystemic
public static void markThreadSystemic()Marks the current thread as systemically important, this is a permanent change. -
executeSystemically
Execute the supplier with the thread's systemic importance set to the value of systemicThread.- Type Parameters:
T
- return type of the supplier- Parameters:
systemicThread
- if the thread should be systemic while executing suppliersupplier
- the operation to execute with the given value of systemicThread- Returns:
- the supplier's return value
-
isSystemic
Determine if an object is systemic. If marking is not enabled, all objects are systemic. If marking is enabled, only objects marked systemic are systemic.- Returns:
- true if o should be treated as systemic object.
-