Class SpanFlags


  • public final class SpanFlags
    extends java.lang.Object
    Represents the 32 bit span flags as specified in the proto definition.

    This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SpanFlags()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getHasParentIsRemoteMask()
      Returns the int (fixed32) representation of the 4 bytes flags with the has_parent_context_is_remote flag bit on.
      static int getParentIsRemoteMask()
      Returns the int (fixed32) representation of the 4 bytes flags with the has_parent_context_is_remote and parent_context_is_remote flag bits on.
      static TraceFlags getTraceFlags​(int flags)
      Returns the W3C TraceFlags (least significant 8 bits) portion from the given 32 bit span flags fields.
      static boolean isKnownWhetherParentIsRemote​(int flags)
      Checks whether the given flags contain information about parent context being remote or not.
      static boolean isParentRemote​(int flags)
      Checks whether in the given flags the parent is marked as remote.
      static int withParentIsRemoteFlags​(TraceFlags traceFlags, boolean isParentRemote)
      Returns the int (fixed32) representation of the TraceFlags enriched with the flags indicating a remote parent.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SpanFlags

        private SpanFlags()
    • Method Detail

      • withParentIsRemoteFlags

        public static int withParentIsRemoteFlags​(TraceFlags traceFlags,
                                                  boolean isParentRemote)
        Returns the int (fixed32) representation of the TraceFlags enriched with the flags indicating a remote parent.
        Parameters:
        isParentRemote - indicates whether the parent context is remote
        Returns:
        the int (fixed32) representation of the TraceFlags enriched with the flags indicating a remote parent.
      • getHasParentIsRemoteMask

        public static int getHasParentIsRemoteMask()
        Returns the int (fixed32) representation of the 4 bytes flags with the has_parent_context_is_remote flag bit on.
        Returns:
        the int (fixed32) representation of the 4 bytes flags with the * has_parent_context_is_remote flag bit on.
      • isKnownWhetherParentIsRemote

        public static boolean isKnownWhetherParentIsRemote​(int flags)
        Checks whether the given flags contain information about parent context being remote or not.
        Parameters:
        flags - The int representation of the 32 bit span flags field defined in proto.
        Returns:
        True, if the given flags contain information about the span's parent context being remote, otherwise, false.
      • getParentIsRemoteMask

        public static int getParentIsRemoteMask()
        Returns the int (fixed32) representation of the 4 bytes flags with the has_parent_context_is_remote and parent_context_is_remote flag bits on.
        Returns:
        the int (fixed32) representation of the 4 bytes flags with the has_parent_context_is_remote and parent_context_is_remote flag bits on.
      • isParentRemote

        public static boolean isParentRemote​(int flags)
        Checks whether in the given flags the parent is marked as remote.
        Parameters:
        flags - The int representation of the 32 bit span flags field defined in proto.
        Returns:
        True, if the given flags contain information about the span's parent context and the parent is marked as remote, otherwise false.
      • getTraceFlags

        public static TraceFlags getTraceFlags​(int flags)
        Returns the W3C TraceFlags (least significant 8 bits) portion from the given 32 bit span flags fields.
        Parameters:
        flags - The int representation of the 32 bit span flags field defined in proto.
        Returns:
        the W3C TraceFlags (least significant 8 bits) portion from the given 32 bit span flags fields.