Interface Subsegment

All Superinterfaces:
java.lang.AutoCloseable, Entity
All Known Implementing Classes:
DummySubsegment, SubsegmentImpl

public interface Subsegment
extends Entity
  • Method Details

    • noOp

      static Subsegment noOp​(AWSXRayRecorder recorder)
    • noOp

      static Subsegment noOp​(Segment parent, AWSXRayRecorder recorder)
    • end

      boolean end()
      Ends the subsegment. Sets the end time to the current time. Sets inProgress to false. Decrements its parent segment's segment-reference counter.
      Returns:
      true if 1) the parent segment now has a ref. count of zero and 2) the parent segment is sampled
    • getNamespace

      @Nullable java.lang.String getNamespace()
      Specified by:
      getNamespace in interface Entity
      Returns:
      the namespace
    • setNamespace

      void setNamespace​(java.lang.String namespace)
      Specified by:
      setNamespace in interface Entity
      Parameters:
      namespace - the namespace to set
    • getParentSegment

      Segment getParentSegment()
      Specified by:
      getParentSegment in interface Entity
      Returns:
      the parentSegment
    • setParentSegment

      void setParentSegment​(Segment parentSegment)
      Parameters:
      parentSegment - the parentSegment to set
    • getPrecursorIds

      java.util.Set<java.lang.String> getPrecursorIds()
      Returns:
      the precursorIds
    • setPrecursorIds

      void setPrecursorIds​(java.util.Set<java.lang.String> precursorIds)
      Parameters:
      precursorIds - the precursorIds to set
    • addPrecursorId

      void addPrecursorId​(java.lang.String precursorId)
      Parameters:
      precursorId - the precursor ID to add to the set
    • streamSerialize

      java.lang.String streamSerialize()
      Serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.
      Returns:
      the string representation of the subsegment with enouogh information for it to be streamed
    • prettyStreamSerialize

      java.lang.String prettyStreamSerialize()
      Pretty-serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own. Only used for debugging.
      Returns:
      the pretty string representation of the subsegment with enouogh information for it to be streamed
    • close

      void close()
      Specified by:
      close in interface java.lang.AutoCloseable