Package 

Interface SpanImpl.Condition


  • 
    public interface SpanImpl.Condition
    
                        

    Represents a possible "block" to a Span being ended naturally. Any conditions that are active when SpanImpl.end is called will prevent the span from being batched and processed, until all of the Conditions are either cancelled, timed-out, or closed. A condition is considered "inactive" until it is upgradeed, at which point the Condition.close will cause the span end-time to be adjusted.

    These are a way to deal with cases where a span "might have child spans at some point in the future, where the parent span end time should match the last of these children".

    • Method Summary

      Modifier and Type Method Description
      abstract Unit close(Long endTime) Close this Condition possibly releasing the underlying Span for batching and processing.
      abstract SpanContext upgrade() Attempt to upgrade this Condition.
      abstract Unit cancel() Cancel this Condition possibly releasing the underlying Span for batching and processing.
      Span wrap(Span span) Wrap a span in a span which also closes this Condition when it ends.
      • Methods inherited from class java.lang.Object

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

      • close

         abstract Unit close(Long endTime)

        Close this Condition possibly releasing the underlying Span for batching and processing. The Span end time may be adjusted to endTime if it is strictly after the existing Span end time.

      • upgrade

         abstract SpanContext upgrade()

        Attempt to upgrade this Condition. A Condition may only be upgraded only be upgraded once, and must still be valid (not closed, or cancelled) in order to be upgraded.

      • cancel

         abstract Unit cancel()

        Cancel this Condition possibly releasing the underlying Span for batching and processing. This function has the same effect as the Condition passing its timeout. The Span this condition is blocking will not be altered by this function.

      • wrap

         Span wrap(Span span)

        Wrap a span in a span which also closes this Condition when it ends. This does not upgrade or change the Condition in any way, the Condition should already be upgradeed when this function is called.