Class SubsegmentImpl

java.lang.Object
com.amazonaws.xray.entities.EntityImpl
com.amazonaws.xray.entities.SubsegmentImpl
All Implemented Interfaces:
Entity, Subsegment, java.lang.AutoCloseable

public class SubsegmentImpl
extends EntityImpl
implements Subsegment
  • Constructor Details

    • SubsegmentImpl

      public SubsegmentImpl​(AWSXRayRecorder creator, java.lang.String name, Segment parentSegment)
  • Method Details

    • end

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

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

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

      public Segment getParentSegment()
      Specified by:
      getParentSegment in interface Entity
      Specified by:
      getParentSegment in interface Subsegment
      Specified by:
      getParentSegment in class EntityImpl
      Returns:
      the parentSegment
    • setParentSegment

      public void setParentSegment​(Segment parentSegment)
      Specified by:
      setParentSegment in interface Subsegment
      Parameters:
      parentSegment - the parentSegment to set
    • addPrecursorId

      public void addPrecursorId​(java.lang.String precursorId)
      Specified by:
      addPrecursorId in interface Subsegment
      Parameters:
      precursorId - the precursor ID to add to the set
    • getPrecursorIds

      public java.util.Set<java.lang.String> getPrecursorIds()
      Specified by:
      getPrecursorIds in interface Subsegment
      Returns:
      the precursorIds
    • setPrecursorIds

      public void setPrecursorIds​(java.util.Set<java.lang.String> precursorIds)
      Specified by:
      setPrecursorIds in interface Subsegment
      Parameters:
      precursorIds - the precursorIds to set
    • shouldPropagate

      public boolean shouldPropagate()
      Description copied from interface: Subsegment
      Determines if this subsegment should propagate its trace context downstream
      Specified by:
      shouldPropagate in interface Subsegment
      Returns:
      true if its trace context should be propagated downstream, false otherwise
    • streamSerialize

      public java.lang.String streamSerialize()
      Description copied from interface: Subsegment
      Serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.
      Specified by:
      streamSerialize in interface Subsegment
      Returns:
      the string representation of the subsegment with enouogh information for it to be streamed
    • prettyStreamSerialize

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

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