Package com.google.cloud.hadoop.util
Class InvocationIdContext
java.lang.Object
com.google.cloud.hadoop.util.InvocationIdContext
A utility class to manage a unique invocation ID for each thread using
InheritableThreadLocal. The invocation ID is used to track and identify requests across
different components.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringRetrieves the current thread's invocation ID.static voidGenerates and sets a new unique invocation ID for the current thread.
-
Constructor Details
-
InvocationIdContext
public InvocationIdContext()
-
-
Method Details
-
getInvocationId
Retrieves the current thread's invocation ID.- Returns:
- the invocation ID for the current thread, or an empty string if not set
-
setInvocationId
public static void setInvocationId()Generates and sets a new unique invocation ID for the current thread. The ID is prefixed withGCCL_INVOCATION_ID_PREFIX.
-