Package com.amazonaws.xray.entities
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
-
-
Field Summary
-
Fields inherited from class com.amazonaws.xray.entities.EntityImpl
mapper, referenceCount, totalSize
-
-
Constructor Summary
Constructors Constructor Description SubsegmentImpl(AWSXRayRecorder creator, java.lang.String name, Segment parentSegment)SubsegmentImpl(AWSXRayRecorder creator, java.lang.String name, Segment parentSegment, SamplingStrategyOverride samplingStrategyOverride)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddPrecursorId(java.lang.String precursorId)voidclose()Implements theAutoCloseableinterface.booleanend()Ends the subsegment.@Nullable java.lang.StringgetNamespace()SegmentgetParentSegment()java.util.Set<java.lang.String>getPrecursorIds()SamplingStrategyOverridegetSamplingStrategyOverride()Deprecated.TraceIDgetTraceId()booleanisRecording()booleanisSampled()java.lang.StringprettyStreamSerialize()Pretty-serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.voidsetNamespace(java.lang.String namespace)voidsetParentSegment(Segment parentSegment)voidsetPrecursorIds(java.util.Set<java.lang.String> precursorIds)voidsetSampledFalse()booleanshouldPropagate()Determines if this subsegment should propagate its trace context downstreamjava.lang.StringstreamSerialize()Serializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.-
Methods inherited from class com.amazonaws.xray.entities.EntityImpl
addException, addSubsegment, checkAlreadyEmitted, compareAndSetEmitted, decrementReferenceCount, getAnnotations, getAws, getCause, getCreator, getEndTime, getHttp, getId, getMetadata, getName, getParent, getParentId, getReferenceCount, getSql, getStartTime, getSubsegments, getSubsegmentsCopy, getSubsegmentsLock, getTotalSize, incrementReferenceCount, isEmitted, isError, isFault, isInProgress, isThrottle, prettySerialize, putAllAws, putAllHttp, putAllSql, putAnnotation, putAnnotation, putAnnotation, putAws, putHttp, putMetadata, putMetadata, putSql, removeSubsegment, serialize, setAnnotations, setAws, setCreator, setEmitted, setEndTime, setError, setFault, setHttp, setId, setInProgress, setMetadata, setParent, setParentId, setSql, setStartTime, setSubsegmentsLock, setThrottle, setTraceId, validateNotNull
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.amazonaws.xray.entities.Entity
addException, addSubsegment, compareAndSetEmitted, decrementReferenceCount, getAnnotations, getAws, getCause, getCreator, getEndTime, getHttp, getId, getMetadata, getName, getParent, getParentId, getReferenceCount, getSql, getStartTime, getSubsegments, getSubsegmentsCopy, getSubsegmentsLock, getTotalSize, incrementReferenceCount, isEmitted, isError, isFault, isInProgress, isThrottle, prettySerialize, putAllAws, putAllHttp, putAllSql, putAnnotation, putAnnotation, putAnnotation, putAws, putHttp, putMetadata, putMetadata, putSql, removeSubsegment, run, run, serialize, setAnnotations, setAws, setCreator, setEmitted, setEndTime, setError, setFault, setHttp, setId, setInProgress, setMetadata, setParent, setParentId, setSql, setStartTime, setSubsegmentsLock, setThrottle, setTraceId
-
-
-
-
Constructor Detail
-
SubsegmentImpl
public SubsegmentImpl(AWSXRayRecorder creator, java.lang.String name, Segment parentSegment)
-
SubsegmentImpl
@Deprecated public SubsegmentImpl(AWSXRayRecorder creator, java.lang.String name, Segment parentSegment, SamplingStrategyOverride samplingStrategyOverride)
Deprecated.
-
-
Method Detail
-
end
public boolean end()
Description copied from interface:SubsegmentEnds the subsegment. Sets the end time to the current time. Sets inProgress to false. Decrements its parent segment's segment-reference counter.- Specified by:
endin interfaceSubsegment- Returns:
- true if 1) the parent segment now has a ref. count of zero and 2) the parent segment is sampled
-
getTraceId
public TraceID getTraceId()
- Specified by:
getTraceIdin interfaceEntity- Overrides:
getTraceIdin classEntityImpl- Returns:
- the traceId
-
getNamespace
public @Nullable java.lang.String getNamespace()
- Specified by:
getNamespacein interfaceEntity- Specified by:
getNamespacein interfaceSubsegment- Overrides:
getNamespacein classEntityImpl- Returns:
- the namespace
-
setNamespace
public void setNamespace(java.lang.String namespace)
- Specified by:
setNamespacein interfaceEntity- Specified by:
setNamespacein interfaceSubsegment- Overrides:
setNamespacein classEntityImpl- Parameters:
namespace- the namespace to set
-
getParentSegment
public Segment getParentSegment()
- Specified by:
getParentSegmentin interfaceEntity- Specified by:
getParentSegmentin interfaceSubsegment- Specified by:
getParentSegmentin classEntityImpl- Returns:
- the parentSegment
-
setParentSegment
public void setParentSegment(Segment parentSegment)
- Specified by:
setParentSegmentin interfaceSubsegment- Parameters:
parentSegment- the parentSegment to set
-
addPrecursorId
public void addPrecursorId(java.lang.String precursorId)
- Specified by:
addPrecursorIdin interfaceSubsegment- Parameters:
precursorId- the precursor ID to add to the set
-
getPrecursorIds
public java.util.Set<java.lang.String> getPrecursorIds()
- Specified by:
getPrecursorIdsin interfaceSubsegment- Returns:
- the precursorIds
-
setPrecursorIds
public void setPrecursorIds(java.util.Set<java.lang.String> precursorIds)
- Specified by:
setPrecursorIdsin interfaceSubsegment- Parameters:
precursorIds- the precursorIds to set
-
shouldPropagate
public boolean shouldPropagate()
Description copied from interface:SubsegmentDetermines if this subsegment should propagate its trace context downstream- Specified by:
shouldPropagatein interfaceSubsegment- Returns:
- true if its trace context should be propagated downstream, false otherwise
-
streamSerialize
public java.lang.String streamSerialize()
Description copied from interface:SubsegmentSerializes the subsegment as a standalone String with enough information for the subsegment to be streamed on its own.- Specified by:
streamSerializein interfaceSubsegment- Returns:
- the string representation of the subsegment with enough information for it to be streamed
-
prettyStreamSerialize
public java.lang.String prettyStreamSerialize()
Description copied from interface:SubsegmentPretty-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:
prettyStreamSerializein interfaceSubsegment- Returns:
- the pretty string representation of the subsegment with enough information for it to be streamed
-
close
public void close()
Description copied from interface:SubsegmentImplements theAutoCloseableinterface. Warning. This method is intended to be private to the xray library and should not be used externally. Instead, useAWSXRay.endSubsegment(Subsegment).- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceSubsegment
-
isRecording
public boolean isRecording()
- Specified by:
isRecordingin interfaceSubsegment
-
setSampledFalse
public void setSampledFalse()
- Specified by:
setSampledFalsein interfaceSubsegment
-
getSamplingStrategyOverride
@Deprecated public SamplingStrategyOverride getSamplingStrategyOverride()
Deprecated.- Specified by:
getSamplingStrategyOverridein interfaceSubsegment
-
-