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 class
ExecutorLocals.Impl
-
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.WithResources
WithResources.None
-
-
Field Summary
Fields Modifier and Type Field Description ClientWarn.State
clientWarnState
TraceState
traceState
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExecutorLocals(TraceState traceState, ClientWarn.State clientWarnState)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
clear()
void
close()
static ExecutorLocals
create(TraceState traceState)
static ExecutorLocals
current()
Closeable
get()
Overwrite current locals, and return the previous onesstatic WithResources
propagate()
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:
get
in interfaceWithResources
- Returns:
- an object that closes any instantiated resources
-
-