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 using InheritableThreadLocal. The invocation ID is used to track and identify requests across different components.
  • Constructor Details

    • InvocationIdContext

      public InvocationIdContext()
  • Method Details

    • 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 with GCCL_INVOCATION_ID_PREFIX.