Package com.google.cloud.hadoop.util
Class InvocationIdContext
- java.lang.Object
-
- com.google.cloud.hadoop.util.InvocationIdContext
-
public class InvocationIdContext extends Object
A utility class to manage a unique invocation ID for each thread usingInheritableThreadLocal. The invocation ID is used to track and identify requests across different components.
-
-
Constructor Summary
Constructors Constructor Description InvocationIdContext()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetInvocationId()Retrieves the current thread's invocation ID.static voidsetInvocationId()Generates and sets a new unique invocation ID for the current thread.
-
-
-
Method Detail
-
getInvocationId
public static String 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.
-
-