Package org.apache.cassandra.concurrent
Class ExecutorLocals
- java.lang.Object
-
- org.apache.cassandra.concurrent.ExecutorLocals
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Closeable,WithResources
public class ExecutorLocals extends java.lang.Object implements WithResources, Closeable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExecutorLocals.Impl-
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.WithResources
WithResources.None
-
-
Field Summary
Fields Modifier and Type Field Description ClientWarn.StateclientWarnStateTraceStatetraceState
-
Constructor Summary
Constructors Modifier Constructor Description protectedExecutorLocals(TraceState traceState, ClientWarn.State clientWarnState)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidclear()voidclose()static ExecutorLocalscreate(TraceState traceState)static ExecutorLocalscurrent()Closeableget()Overwrite current locals, and return the previous onesstatic WithResourcespropagate()Thecurrent()Locals, if any; otherwiseWithResources.none().-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.utils.WithResources
and, isNoOp
-
-
-
-
Field Detail
-
traceState
public final TraceState traceState
-
clientWarnState
public final ClientWarn.State clientWarnState
-
-
Constructor Detail
-
ExecutorLocals
protected ExecutorLocals(TraceState traceState, ClientWarn.State clientWarnState)
-
-
Method Detail
-
current
public static ExecutorLocals current()
- Returns:
- an ExecutorLocals object which has the current trace state and client warn state.
-
propagate
public static WithResources propagate()
Thecurrent()Locals, if any; otherwiseWithResources.none(). Used to propagate current to other executors as aWithResources.
-
create
public static ExecutorLocals create(TraceState traceState)
-
clear
public static void clear()
-
get
public Closeable get()
Overwrite current locals, and return the previous ones- Specified by:
getin interfaceWithResources- Returns:
- an object that closes any instantiated resources
-
-