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 booleanuseGlobalContext
-
Constructor Summary
Constructors Constructor Description ThreadLocalContextStorage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidclear()static <T> Tget(java.lang.String key)java.lang.StringgetDistributedExecutionIndex()Get the execution index for the current request.VectorClockgetOriginVectorClock()Get incoming vector clock for the current request.java.lang.StringgetRequestId()Get request identifier for the current request from the context.VectorClockgetVectorClock()Get vector clock for the current request from the context.static <T> voidset(java.lang.String key, T value)voidsetDistributedExecutionIndex(java.lang.String distributedExecutionIndex)Set the execution index in the context.voidsetOriginVectorClock(VectorClock originVectorClock)Set the incoming vector clock in the context.voidsetRequestId(java.lang.String requestId)Set the current request id in the context.voidsetVectorClock(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:ContextStorageGet request identifier for the current request from the context.- Specified by:
getRequestIdin interfaceContextStorage- Returns:
- request id for the current request.
-
getVectorClock
public VectorClock getVectorClock()
Description copied from interface:ContextStorageGet vector clock for the current request from the context.- Specified by:
getVectorClockin interfaceContextStorage- Returns:
- vector clock for the current request.
-
getOriginVectorClock
public VectorClock getOriginVectorClock()
Description copied from interface:ContextStorageGet incoming vector clock for the current request.- Specified by:
getOriginVectorClockin interfaceContextStorage- Returns:
- vector clock for the incoming request that triggered this request.
-
getDistributedExecutionIndex
public java.lang.String getDistributedExecutionIndex()
Description copied from interface:ContextStorageGet the execution index for the current request.- Specified by:
getDistributedExecutionIndexin interfaceContextStorage- Returns:
- execution index for the current request.
-
setRequestId
public void setRequestId(java.lang.String requestId)
Description copied from interface:ContextStorageSet the current request id in the context.- Specified by:
setRequestIdin interfaceContextStorage- Parameters:
requestId- the identifier for the request.
-
setVectorClock
public void setVectorClock(VectorClock vectorClock)
Description copied from interface:ContextStorageSet the vector clock in the context.- Specified by:
setVectorClockin interfaceContextStorage- Parameters:
vectorClock- vector clock for the current request.
-
setOriginVectorClock
public void setOriginVectorClock(VectorClock originVectorClock)
Description copied from interface:ContextStorageSet the incoming vector clock in the context.- Specified by:
setOriginVectorClockin 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:ContextStorageSet the execution index in the context.- Specified by:
setDistributedExecutionIndexin interfaceContextStorage- Parameters:
distributedExecutionIndex- execution index for the current request.
-
-