Class ThreadLocalContextStorage
- java.lang.Object
-
- cloud.filibuster.instrumentation.storage.ThreadLocalContextStorage
-
- All Implemented Interfaces:
ContextStorage
public class ThreadLocalContextStorage extends java.lang.Object implements ContextStorage
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
useGlobalContext
-
Constructor Summary
Constructors Constructor Description ThreadLocalContextStorage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
clear()
static <T> T
get(java.lang.String key)
java.lang.String
getDistributedExecutionIndex()
Get the execution index for the current request.VectorClock
getOriginVectorClock()
Get incoming vector clock for the current request.java.lang.String
getRequestId()
Get request identifier for the current request from the context.VectorClock
getVectorClock()
Get vector clock for the current request from the context.static <T> void
set(java.lang.String key, T value)
void
setDistributedExecutionIndex(java.lang.String distributedExecutionIndex)
Set the execution index in the context.void
setOriginVectorClock(VectorClock originVectorClock)
Set the incoming vector clock in the context.void
setRequestId(java.lang.String requestId)
Set the current request id in the context.void
setVectorClock(VectorClock vectorClock)
Set the vector clock in the context.
-
-
-
Method Detail
-
clear
public static void clear()
-
set
public static <T> void set(java.lang.String key, T value)
-
get
public static <T> T get(java.lang.String key)
-
getRequestId
public java.lang.String getRequestId()
Description copied from interface:ContextStorage
Get request identifier for the current request from the context.- Specified by:
getRequestId
in interfaceContextStorage
- Returns:
- request id for the current request.
-
getVectorClock
public VectorClock getVectorClock()
Description copied from interface:ContextStorage
Get vector clock for the current request from the context.- Specified by:
getVectorClock
in interfaceContextStorage
- Returns:
- vector clock for the current request.
-
getOriginVectorClock
public VectorClock getOriginVectorClock()
Description copied from interface:ContextStorage
Get incoming vector clock for the current request.- Specified by:
getOriginVectorClock
in interfaceContextStorage
- Returns:
- vector clock for the incoming request that triggered this request.
-
getDistributedExecutionIndex
public java.lang.String getDistributedExecutionIndex()
Description copied from interface:ContextStorage
Get the execution index for the current request.- Specified by:
getDistributedExecutionIndex
in interfaceContextStorage
- Returns:
- execution index for the current request.
-
setRequestId
public void setRequestId(java.lang.String requestId)
Description copied from interface:ContextStorage
Set the current request id in the context.- Specified by:
setRequestId
in interfaceContextStorage
- Parameters:
requestId
- the identifier for the request.
-
setVectorClock
public void setVectorClock(VectorClock vectorClock)
Description copied from interface:ContextStorage
Set the vector clock in the context.- Specified by:
setVectorClock
in interfaceContextStorage
- Parameters:
vectorClock
- vector clock for the current request.
-
setOriginVectorClock
public void setOriginVectorClock(VectorClock originVectorClock)
Description copied from interface:ContextStorage
Set the incoming vector clock in the context.- Specified by:
setOriginVectorClock
in interfaceContextStorage
- Parameters:
originVectorClock
- vector clock for the incoming request that triggered this request.
-
setDistributedExecutionIndex
public void setDistributedExecutionIndex(java.lang.String distributedExecutionIndex)
Description copied from interface:ContextStorage
Set the execution index in the context.- Specified by:
setDistributedExecutionIndex
in interfaceContextStorage
- Parameters:
distributedExecutionIndex
- execution index for the current request.
-
-